4D v16.3KILL WORKER |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
4D v16.3
KILL WORKER
|
KILL WORKER {( process )} | ||||||||
Parameter | Type | Description | ||||||
process | Text, Longint |
![]() |
Number or name of process to kill (kills current process if omitted) | |||||
The KILL WORKER command posts a message to the worker process whose name or number you passed in process, asking it to ignore any pending messages and to terminate its execution as soon as the current task ends.
This command can only be used with worker processes. For more information, please refer to the About workers section.
In process, you pass either the name or number of the worker process whose execution needs to be terminated. If no worker with the specified process name or number exists, KILL WORKER does nothing.
If you do not pass any parameter, KILL WORKER applies to the currently running worker and is therefore equivalent to KILL WORKER (Current process).
If KILL WORKER is applied to a worker that was not created explicitly using the CALL WORKER command (for example, the main application worker), it only asks this worker to empty its message box. Consequently, KILL WORKER (1) does nothing.
The following code (executed from a form, for example) triggers the termination of a worker:
CALL WORKER(vWorkerName;"theWorker";"end")
In the worker method (theWorker), you add some code to handle this situation:
//theWorker method
C_TEXT($1) //param
Case of
:($1="call") //the worker is called
... //do something
:($1="end") //the worker is asked to kill itself
KILL WORKER
End case
Product: 4D
Theme: Process (Communications)
Number:
1390
Created: 4D v15 R5
4D Language Reference ( 4D v16)
4D Language Reference ( 4D v16.1)
4D Language Reference ( 4D v16.2)
4D Language Reference ( 4D v16.3)