Sig.BullMQ.Queue (Sig v0.1.0)

Copy Markdown View Source

Enqueues workflow nodes as BullMQ jobs.

Each job carries an execution_id and a node_name and is processed by Sig.BullMQ.Worker. You normally don't call this module directly; use Sig.start_execution/2 with async: true.

Configuration

Summary

Functions

Returns the configured Redis connection name.

Enqueues every node of an execution that is currently ready to run.

Enqueues a single node of an execution.

Returns the configured BullMQ queue name.

Functions

connection()

@spec connection() :: atom()

Returns the configured Redis connection name.

enqueue_execution(execution_id)

@spec enqueue_execution(String.t()) :: {:ok, non_neg_integer()} | {:error, :not_found}

Enqueues every node of an execution that is currently ready to run.

Returns {:ok, count} with the number of enqueued nodes, or {:error, :not_found}.

enqueue_node(execution_id, node_name, opts \\ [])

@spec enqueue_node(String.t(), String.t() | atom(), keyword()) ::
  {:ok, term()} | {:error, term()}

Enqueues a single node of an execution.

The job ID is "<execution_id>:<node_name>", so enqueuing the same node twice does not create a duplicate job. opts are passed to BullMQ.Queue.add/4 and override the defaults.

queue_name()

@spec queue_name() :: String.t()

Returns the configured BullMQ queue name.