Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Wakeups (LISTEN/NOTIFY)

LISTEN/NOTIFY wakes workers at once for new jobs, pause and resume, force-cancel, and manual cron runs. SimpleDb, HasqlDb, and custom MonadArbiter instances supply the listener.

Without a listener, workers poll every pollInterval. Control paths fall back to:

PathWithout a listener
Pause and resumethe next worker heartbeat (workerHeartbeatInterval)
Cron run-nowthe scheduler's next tick
Force-cancelthe next job heartbeat (jobHeartbeatInterval)

The listener opens with the first worker pool and holds one pool connection. A producer-only process opens none.

useDedicatedListener opens a separate listener connection:

import Arbiter.Hasql qualified as ArbH
import Pqi.Ffi qualified as Ffi

env <- ArbS.useDedicatedListener connStr =<< ArbS.createSimpleEnv (Proxy @AppRegistry) connStr "arbiter"

let connect = ArbH.toHasqlConnect Ffi.adapter connStr
env <- ArbH.useDedicatedListener connect =<< ArbH.createHasqlEnv (Proxy @AppRegistry) connect "arbiter"

disableListener switches to polling:

env <- ArbS.disableListener <$> ArbS.createSimpleEnv (Proxy @AppRegistry) connStr "arbiter"