March Docs

Conduit.Shutdown

Conduit.Shutdown — in-process drain flag for graceful worker shutdown.

When Conduit.API.stop is called, it sets the draining flag here before waiting for in-flight jobs to complete and deregistering the node. Each worker task checks is_draining at the top of its poll loop and exits cleanly rather than fetching another job.

The flag is local to the current OS process — each node must be stopped individually. It is never reset automatically; restart the process to resume processing after a drain.

Functions

fnclear_drainingclear_draining() : ()#

Clear the drain flag. Useful in tests to reset state between runs.

fnis_drainingis_draining() : Bool#

Return true if this node is in drain mode.

fnset_drainingset_draining() : ()#

Signal all workers on this node to stop polling for new jobs.

Workers finish any in-flight job they have already claimed, then exit their
poll loop cleanly.  Call `Conduit.API.stop` instead of this directly — it
sets the flag and also waits for the drain timeout and deregisters the node.