#1 2018-07-10 07:45:37

Dimitri
Member
Registered: 2018-06-08
Posts: 5

Callback Timeout

Hi,

I modified the sample project 31 (LongWorkServer and LongWorkClient) to change the callback procedures into functions (WorkFinished and WorkFailed).
I added Sleep(5000) into these functions to simulate a long work into the callback functions.
I have this error message :

"TInterfacedObjectFakeServer.FakeCall(ILongWorkCallback.WorkFinished) failed: 'TWebSocketServerRest.Callback(1) received status=404 from root/LongWorkCallback.WorkFinished/1''

How could I set the timeout ?

Thx

Offline

#2 2018-07-10 07:53:34

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,670
Website

Re: Callback Timeout

It doesn't make any sense to have such a blocking process, even on the callback.
Callbacks were implemented first to avoid blocking processes from the main service calls, and make it asynchronous.
So synchronous/blocking process in the callback is a design error.

The callback is blocking, and should respond quick - even for a function.
This is a requirement, well documented IIRC.
It has also the risk of making a race condition in your implementation, from the mutex/CriticalSections you will use to protect shared objects.
Use asynch process - see https://synopse.info/files/html/Synopse … l#TITL_196 - and just return the execution state from the main REST methods, from client to server.

Offline

#3 2018-07-10 08:43:01

Dimitri
Member
Registered: 2018-06-08
Posts: 5

Re: Callback Timeout

Thank you for your quick answer.

Offline

Board footer

Powered by FluxBB