arr1
Common lisp background workers, eventually a task queue and task orchestration (coordination).
NOTE: Your application must handle process termination signals to stop the application.
There are 2 function to start and stop the background worker:
(arr.background-worker:start-application &key (number-of-workers 1))(arr.background-worker:stop-application app)Same as arr.background-worker, but the state is controlled internally
on this package.
(arr.global-background-worker:start-application &key (number-of-workers 1))(arr.global-background-worker:stop-application)All the generics are available in other to build your worker.
task is a generic definition and can be executed by all workers available.
It is (supposed) a stateless function that is fire and forget.
(defgeneric task (task-name task-data &key time &allow-other-keys))enqueue-task and dequeue-task especified by the data store implementation.
(defgeneric enqueue-task (data-source task &key app &allow-other-keys))(defgeneric dequeue-task (data-source &key app &allow-other-keys))task-runner is the engine of the dispatcher worker. At this moment, all tasks, immediate or schedules, are ready to dispatch.
(defgeneric task-runner (app &key &allow-other-keys))Just like task-runner, task-scheduler is the engine of the scheduling and queueing tasks when they are ready to be dispatched.
(defgeneric task-scheduler (app &key &allow-other-keys))schedule-task receives the "task plan":
- How it should be scheduled
- Task data
(defgeneric schedule-task (data-source scheduled-time task &key app &allow-other-keys))(defgeneric execute-task (app task-name &optional data))(defgeneric execute-task-at (app time task-name &optional data))Footnotes
-
arris the name of the function of the haskell'sControl.Arrowspackage, that lifts a pure function into a computation. ↩