March Docs

Conduit

Conduit — job queue and durable workflow engine for March.

This module is the top-level namespace. It re-exports the types shared across all subsystems (errors, config, job metadata, workflow types, etc.) and provides thin forwarding wrappers so callers can write Conduit.pause_cron(...) instead of the fully-qualified Conduit.API.pause_cron(...).

Typical startup sequence:

  1. Register performers: Conduit.API.register(job_type, performer, config)
  2. Register crons: Conduit.API.register_cron(cron_type, cron_config, performer)
  3. Register workflows: Conduit.API.register_workflow(wf_type, runner, wf_config)
  4. Start the engine: Conduit.API.start(config, storage)

All types below are intentionally kept in this file so that library consumers have a single import point for the entire Conduit type vocabulary.

Types

typeConduitErrorConduitError = Retry(String) | Discard(String) | Snooze(Int) | WorkerError(String)#
typeSchemaSchema(a) = { validator : Option(a -> Result((), String)) }#
typeBackoffBackoff =#
typeUniqueScopeUniqueScope = PerQueue | Global#
typeUniqueConstraintUniqueConstraint = {#
typeUniqueConflictUniqueConflict = Ignore | Replace | Raise#
typePerKeyRateLimitPerKeyRateLimit = {#
typeRateLimiterBackendRateLimiterBackend =#
typeRateLimitRateLimit = {#
typeJobConfigJobConfig = {#
typeJobInfoJobInfo = {#
typeRetentionConfigRetentionConfig = {#
typeConfigConfig = {#
typeCronOverlapCronOverlap = Skip | Allow | Replace#
typeCronConfigCronConfig = {#
typeCronScheduleCronSchedule = {#
typeJobRowJobRow = {#
typeDeadLetterDeadLetter = {#
typeNodeInfoNodeInfo = {#
typeWorkflowErrorWorkflowError =#
typeExecutionModeExecutionMode = Checkpoint | DeterministicReplay#
typeWorkflowConfigWorkflowConfig = {#
typeWorkflowHandleWorkflowHandle = {#
typeWorkflowRowWorkflowRow = {#
typeWorkflowCheckpointWorkflowCheckpoint = {#
typeWorkflowSignalWorkflowSignal = {#
typeWorkflowContextWorkflowContext = {#
typeWorkflowEventWorkflowEvent = {#
typeAuthAuth =#

Interfaces

interfaceStorageStorage(s)#

Functions

fncancel_croncancel_cron(storage : s, cron_id : String) : Result((), String)#

Permanently delete a cron schedule by id. See Conduit.API.cancel_cron.

fncancel_workflowcancel_workflow(workflow_id : String, reason : String, storage : s) : Result((), String)#

Cancel a running workflow with a human-readable reason. See Conduit.API.cancel_workflow.

fncluster_leadercluster_leader() : Option(String)#

Return the node_id of the current leader from this node's in-process view.

Updated by the background leader-election task each heartbeat cycle.  Returns
None if this node has not yet completed its first election tick.
fnenqueue_allenqueue_all(items : List((String, String, JobConfig)), storage : s) : List(Result(String, String))#

Enqueue multiple jobs in one call. See Conduit.API.enqueue_all.

fnpause_cronpause_cron(storage : s, cron_id : String) : Result((), String)#

Disable a cron schedule by id. See Conduit.API.pause_cron.

fnpause_queuepause_queue(queue : String) : ()#

Pause all workers polling queue on this node. See Conduit.API.pause_queue.

fnresume_cronresume_cron(storage : s, cron_id : String) : Result((), String)#

Re-enable a paused cron schedule by id. See Conduit.API.resume_cron.

fnresume_queueresume_queue(queue : String) : ()#

Resume all workers polling queue on this node. See Conduit.API.resume_queue.