Sig.BullMQ.Worker (Sig v0.1.0)

Copy Markdown View Source

Processes the BullMQ jobs enqueued by Sig.BullMQ.Queue.

For each job it runs the node with Sig.Engine.execute_node/2. On success, it enqueues the nodes that became runnable, or marks the execution as completed when every node is done. When the node fails on its last attempt, the execution is marked as failed.

Jobs for suspended or stopped executions (or workflows) are acknowledged without running the node.

Started by Sig.BullMQ.Supervisor; use process_job/1 as the processor if you run your own BullMQ.Worker.

Summary

Functions

Processes a job whose data contains "execution_id" and "node_name".

Functions

process_job(job)

@spec process_job(BullMQ.Job.t()) :: :ok | {:ok, term()} | {:error, term()}

Processes a job whose data contains "execution_id" and "node_name".

Returns {:ok, result} or :ok when the job should be acknowledged, and {:error, reason} when the node failed.