I am trying to turn my app multithreading. What I want to achieve is: - Receive command via TidHTTPServer - Execute local action (might involve using tidHTTP to send/receive data to other services) - return execution result to the original caller
since I am pretty new to multi-threading I would like to know if my design-idea is correct
- TMsgHandler=Class(TThread)
- in TidHTTPServer.OnCommandGet I create a new instance of TMsgHandler and pass ARequestInfo and AResponseInfo
- TMsgHandler.Excecute interprest the data
- Can TMsgHandler.Execeute use Objects (descendants of TidHTTP) in my Main to communicate with other services?
- TMsgHandler sends answer through AResponseInfo and terminates.
will this work?