FIFO offline node batching owned by the caller's process state.
This mirrors Baileys' offline queue semantics without introducing a separate process: the owner keeps the queue in its state, drains up to 10 nodes per pass, and lets the caller reschedule the next drain when work remains.
Summary
Functions
Drains up to the configured batch size of nodes from the queue.
Pushes a new node onto the offline processing queue.
Initializes a new offline queue.
Types
@type drain_result() :: %{processed_count: non_neg_integer(), continue?: boolean()}
@type node_type() :: :message | :call | :receipt | :notification
@type t() :: %BaileysEx.Message.OfflineQueue{ batch_size: pos_integer(), buffering?: boolean(), queue: term() }
Functions
@spec drain(t(), map(), (node_type(), BaileysEx.BinaryNode.t() -> :ok | {:error, term()})) :: {:ok, t(), drain_result()} | {:error, term(), t()}
Drains up to the configured batch size of nodes from the queue.
@spec enqueue(t(), node_type(), BaileysEx.BinaryNode.t()) :: t()
Pushes a new node onto the offline processing queue.
Initializes a new offline queue.