You are not logged in.
Hi all,
I used a THttpApiServer to build an http server.
In most of demos, we write Ctxt.OutContent to respond within OnRequest event handle.
But now, I would like to do something like these steps:
1. Exit OnRequest event handle (of cause taking some needed params of this Ctxt).
2. Do something that will take a long time, and prepare something to be responded. (e.g. ask for data from another server)
3. Respond something via the Ctxt.
Is it possible?
(As I knew, ICS is able to do these things, of cause ICS is a single thread component)
Thanks
Regards
Last edited by assistant (2022-04-13 04:23:22)
Offline
No, it is not possible: THttpApiServer.Execute has its own loop running the pending requests in a raw.
You could increase the number of threads.
Anyway, I would switch to polling or WebSockets if the request is blocking for a long time.
Offline
Hi Administrator,
I got your point.
Thanks
Regards
Offline