class

JoobQ::WorkerRegistry

Inherits Reference < Object

Publishes this process as a worker: a heartbeat refreshes a TTL'd hash and an index entry, so crashed processes disappear on their own.

Constants

INDEX = "joobq:workers"
INTERVAL = 10.seconds
Log = ::Log.for("WORKER_REGISTRY")
PREFIX = "joobq:worker:"
TTL = 30.seconds

Constructors

new(store : RedisStore = RedisStore.instance, id : String = "#{System.hostname}:#{Process.pid}")
Source

Class methods

all(redis : Redis::PooledClient = RedisStore.instance.redis) : Array(WorkerInfo)

Live workers, newest heartbeat first. Entries whose TTL lapsed are pruned.

Source

Instance methods

beat(status : String = "running") : Nil
Source
follow_desired_concurrency

Follows worker counts an operator set after this process started; a redeploy with new config therefore wins over an older operator choice.

Source
start
Source
stop
Source