# `Sig.BullMQ.Queue`
[🔗](https://github.com/peeeuzin/sig/blob/v0.1.0/lib/sig/bullmq/queue.ex#L1)

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

  * `:bullmq_queue_name` - the queue name. Defaults to `"sig_workflows"`.
  * `:bullmq_connection` - the name of the `BullMQ.RedisConnection` process.
    Defaults to `:sig_redis`, the one started by `Sig.BullMQ.Supervisor`.

# `connection`

```elixir
@spec connection() :: atom()
```

Returns the configured Redis connection name.

# `enqueue_execution`

```elixir
@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`

```elixir
@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`

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

Returns the configured BullMQ queue name.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
