[fpc-pascal] CGI/FastCGI and WS request with a max time response

Marcos Douglas B. Santos md at delfire.net
Fri Jan 5 02:20:02 CET 2018

On Thu, Jan 4, 2018 at 10:33 PM, leledumbo via fpc-pascal
<fpc-pascal at lists.freepascal.org> wrote:
>> The problem is that the WS could take so long time that the entire request
> will broke with a "time out".
> I suggest making the request handling asynchronous instead. So request will
> only register and return some unique id to the requester, then do call to
> the WS in background thread. An endpoint shall be provided that when given a
> unique id will check whether the corresponding thread has finished executing
> or not, returning 200 + response data when done, and 202 if still in
> progress. This endpoint shall be called in regular interval by the
> requester, until it finishes processing or your server dies (500).

Interesting, but I can't do this way.
It should be just one call from client (desktop app and website) to my
REST service.
My service encapsulates the WS.
As I wrote previously to Michael, if the WS do not respond in "X
seconds", my service should forget it and return a "code Y".

Marcos Douglas

More information about the fpc-pascal mailing list