Overview

Ordoq is a bounded, local, in-memory priority queue for asynchronous Elixir callbacks. Adding the dependency starts its queue and supervised worker pool automatically.

Responsibilities

Non-responsibilities

Ordoq is intended for process-local background work. It is not durable, does not coordinate multiple BEAM instances, and loses queued work when its owning instance stops. Use RabbitMQ or another durable system when work must survive instance replacement or cross service boundaries.

Contract

Installation

def deps do
[
{:ordoq, "~> 0.1"}
]
end

Workspace development may use the repository's established local-path/Git-tag dependency helper. Consumer fixtures, tests, documentation output, and development tools are excluded from the released package.

Basic use

Callbacks receive a timeout-extension function before their declared arguments:

defmodule MailJob do
def deliver(touch, recipient) do
:ok = touch.(nil)
send(recipient, :delivered)
end
end
{:ok, job_id} = Ordoq.enqueue(MailJob, :deliver, [self()], priority: 5)

Passing nil to the touch function restarts the callback's configured time-to-run. A positive millisecond value requests a different duration within the configured maximum.

See Usage for configuration and lifecycle details and Examples for focused patterns.

Name origin

Ordoq is a coined functional name for an ordered queue. It reflects the library's responsibility for priority and FIFO ordering without implying a durable or distributed job system.

Telemetry

Every event is emitted through :telemetry under [:ordoq, ...]; Ordoq.Telemetry documents their measurements and metadata:

Job names, identifiers, arguments, results, and exception text are never metric tags. Ordoq does not start a metrics exporter or HTTP listener.