Mosquito::Runners::Overseer
Inherits Mosquito::Runnable < Mosquito::Runners::RunAtMost < Mosquito::Runners::IdleWait < Reference < Object
The Overseer is responsible for managing:
- a
Coordinator - an
Executor - the
QueueList - any idle state as configured
An overseer manages the loop that each thread or process runs.
Constants
Log = ::Log.for(self)
Constructors
new
SourceInstance methods
build_executor
Sourcecheck_for_deceased_runners
If an executor dies, it's probably because a bug exists somewhere in Mosquito itself.
When a job fails any exceptions are caught and logged. If a job causes something more catastrophic we can try to recover by spawning a new executor.
coordinator
Sourcedequeue_job?
Weaknesses: This implementation sometimes starves queues because it doesn't round robin, prioritize queues, or anything else.
each_run
The goal for the overseer is to:
- Ensure that the coordinator gets run frequently to schedule delayed/periodic jobs.
- Wait for an executor to be idle, and dequeue work if possible.
- Monitor the executor pool for unexpected termination and respawn.
executors
Sourceidle_notifier
When an executor transitions to idle it will send a True here. The Overseer uses this as a signal to check the queues for more work.
idle_wait
Sourcequeue_list
Sourcesleep
Source