- stretch 4.5.1-18.1
ns_job(3aolserver) | AOLserver Built-In Commands | ns_job(3aolserver) |
NAME¶
ns_job - commandsSYNOPSIS¶
ns_job option ?arg arg ...?ns_job create ?-desc description? queueId ?maxthreads?
ns_job queue ?-detached? queueId script
ns_job wait ?-timeout seconds:microseconds? queueId jobId
ns_job waitany ?-timeout seconds:microseconds? queueId
ns_job cancel queueId jobId
ns_job delete queueId
ns_job jobs queueId
ns_job queues
ns_job threadlist
ns_job queuelist
ns_job joblist
ns_job genid
DESCRIPTION¶
ns_job manages a thread pool and a set of named "queues". Queues have a max number of threads and when the current number of running thread reaches "max" then jobs are queued.New threads are created when there are less than maxthread number of idle threads.
OPTIONS¶
createCreate a new job queue called queueId. If maxthreads is not specified, then the default of 4 is used.
queue
Add a new job to the queue. If there are less than maxthreads current running then the job will be started. If there are maxthreads currently running then this new job will be queued.
If detached is true, then the job will be cleaned up when it completes; no wait will be necessary.
The new job's ID is returned.
wait
Wait for the specified queued or running job to finish. wait returns the results of the script.
An error is thrown if the specified timeout period is reached.
waitany
Wait for any job on the queue complete.
An error is thrown if the specified timeout period is reached.
cancel
Remove the specified job from the queue. If the job is currently running, then the job will be removed from the queue when it completes.
1 (true) is returned if the job is currently running and can not be cancelled.
delete
Request that the specified queue be deleted. The queue will only be deleted when all jobs are removed.
jobs
Return a list of the job IDs.
queues
threadlist
maxthreads
numthreads
numidle
req
queuelist
name
desc
maxthreads
numrunning
REQ
joblist
id
state
results
code
TYPE
REQ
genid
BUGS¶
SEE ALSO¶
nsd(1), info(n)KEYWORDS¶
ns_job4.0 | AOLserver |