I am looking into using CALL WORKER / CALL FORM for an interface where certain 
actions will query a service, which could take up to a few seconds. Using CALL 
WORKER and CALL FORM would allow me to split the long-running part to the 
worker without having to roll my own IP messaging and the On Outside Call 
misery. 

However, the problem is if the user spastically clicks things and several 
actions are queued which will take a few seconds to complete, there appears to 
be no way to remove unprocessed messages from the message queue. There also 
appears no way for a worker to see how many messages it has waiting, so it 
can’t discard them to skip to the last one itself. One possibility is using 
KILL WORKER before CALL WORKER. According to the documentation:

"If the  CALL WORKER command is called to send a message to a worker that was 
just killed by KILL WORKER, a new process is started. To make sure that there 
is only one process running at a time for a worker, the new process will start 
after the previous one is actually terminated.”

However, in the following sequence:

KILL WORKER(“QueryService”)
CALL WORKER(“QueryService”;”LongRunningQuery”;1)

… QueryService is processing query 1 ...
… user clicks something else …

KILL WORKER(“QueryService”)
CALL WORKER(“QueryService”;”LongRunningQuery”;2)

… QueryService is still processing query 1 ...
… user clicks something else …

KILL WORKER(“QueryService”)
CALL WORKER(“QueryService”;”LongRunningQuery”;3)

… more time passes ….
… query 1 finishes …

Is query 2 or query 3 started?

Is there a way to find out if the current worker process was killed? This would 
allow stopping in the worker before finishing, or not calling CALL FORM with 
results the form no longer wants. Maybe process status from PROCESS PROPERTIES? 

Jim Crate
**********************************************************************
4D Internet Users Group (4D iNUG)
Archive:  http://lists.4d.com/archives.html
Options: https://lists.4d.com/mailman/options/4d_tech
Unsub:  mailto:[email protected]
**********************************************************************

Reply via email to