class

Mosquito::Runners::Executor

Inherits Mosquito::Runnable < Mosquito::Runners::RunAtMost < Reference < Object

The executor is the center of work in Mosquito, and it's is the demarcation point between Mosquito framework and application code. Above the Executor is entirely Mosquito, and below it is application code.

An Executor is responsible for hydrating Job classes with deserialized parameters and calling Mosquito::Job#run on them. It measures the time it takes to run a job and provides detailed log messages about the current status.

An executor is a Mosquito::Runnable and should be interacted with according to the Runnable API.

To build an executor, provide a job input channel and an idle bell channel. These channels can be shared between all available executors.

The executor will ring the idle bell when it is ready to accept work and then wait for work to show up on the job pipeline. After the job is finished it will ring the bell again and wait for more work.

Constants

Log = ::Log.for(self)

Constructors

new(job_pipeline : Channel(Tuple(Mosquito::JobRun, Mosquito::Queue)), idle_bell : Channel(Bool))
Source

Instance methods

execute(job_run : JobRun, from_queue q : Queue)

Runs a job from a Queue.

Execution time is measured and logged, and the job is either forgotten or, if it fails, rescheduled.

Source
failed_job_ttl

How long a job config is persisted after failure

Source
failed_job_ttl=(failed_job_ttl : Int32)

How long a job config is persisted after failure

Source
idle_bell

Used to notify the overseer that this executor is idle.

Source
job_pipeline

Where work is received from the overseer.

Source
successful_job_ttl

How long a job config is persisted after success

Source
successful_job_ttl=(successful_job_ttl : Int32)

How long a job config is persisted after success

Source