Jesus asked him, "What is your name?" And he said, "My name is Legion, for we are many." ── Gospel of Mark chapter 5, verse 9
(defparameter *worker*
(make-worker
(lambda (job)
(format t "Processed: ~S~%" job))))
(start *worker*)
(add-job *worker* 10)
(add-job *worker* "Hi")
(stop *worker*)(defparameter *cluster*
(make-cluster 4
(lambda (job)
(format t "Processed: ~S~%" job))))
(start *cluster*)
(add-job *cluster* 10)
(add-job *cluster* "Hi")
(stop *cluster*)NOTE: Cluster doesn't guarantee the order of processing jobs.
Base class of workers.
You can specify the value by specifying :queue.
Return the worker's status which is specifically one of :running, :idle, :shutting and :shutdown.
Return the number of outstanding jobs of the worker.
Start the given worker or cluster to process jobs.
Stop the given worker or cluster after processing its queued jobs.
Stop the given worker or cluster immediately (outstanding jobs will be remained in its queue).
Enqueue a new job val which will be passed to a function specified for make-worker.
Dequeue a job from worker's queue.
Base class of clusters.
Return the cluster's status which is one of :running, :shutting and :shutdown.
Start workers of cluster.
Return workers of cluster in simple-array.
- Eitaro Fukamachi (e.arrows@gmail.com)
Copyright (c) 2015 Eitaro Fukamachi (e.arrows@gmail.com)
Licensed under the BSD 3-Clause License.