Exq.Adapters.Queue behaviour (exq v0.19.0) View Source

Behaviour for creating Exq queue adapters.

Example

defmodule Exq.Adapters.Queue.CustomAdapter do
  @behaviour Exq.Adapters.Queue
  def enqueue(pid, queue, worker, args, options) do
    {:ok, apply(worker, :perform, args)}
  end

  def enqueue_at(pid, queue, time, worker, args, options) do
    enqueue_somehow(pid, queue, time, worker, args, options)
  end

  def enqueue_in(pid, queue, offset, worker, args, options) do
    enqueue_in_somehow(pid, queue, offset, worker, args, options)
  end
end

Link to this section Summary

Types

The GenServer name

The server reference

Link to this section Types

Specs

name() :: atom() | {:global, term()} | {:via, module(), term()}

The GenServer name

Specs

server() :: pid() | name() | {atom(), node()}

The server reference

Link to this section Callbacks

Link to this callback

enqueue(server, arg2, module, list, list)

View Source

Specs

enqueue(server(), String.t(), module(), list(), list()) :: tuple()
Link to this callback

enqueue_all(server, list)

View Source

Specs

enqueue_all(server(), list()) :: tuple()
Link to this callback

enqueue_at(server, arg2, arg3, module, list, list)

View Source

Specs

enqueue_at(server(), String.t(), DateTime.t(), module(), list(), list()) ::
  tuple()
Link to this callback

enqueue_in(server, arg2, integer, module, list, list)

View Source

Specs

enqueue_in(server(), String.t(), integer(), module(), list(), list()) :: tuple()