exq v0.8.5 Exq

Summary

Functions

Enqueue a job immediately

Schedule a job to be enqueued at a specific time in the future

Schedule a job to be enqueued at in the future given by offset in milliseconds

Callback implementation for c:Application.start/2

Subscribe to a queue - ie. listen to queue for jobs

  • pid - PID for Exq Manager or Enqueuer to handle this
  • queue - Name of queue
  • concurrency - Optional argument specifying max concurrency for queue

Unsubscribe from a queue - ie. stop listening to queue for jobs

  • pid - PID for Exq Manager or Enqueuer to handle this
  • queue - Name of queue

Get the job metadata

  • name - registered name of Exq. Only necessary if the custom name option is used when starting Exq. Defaults to Exq
  • pid - pid of the worker. Defaults to self()

Functions

enqueue(pid, queue, worker, args)

Enqueue a job immediately.

Expected args:

  • pid - PID for Exq Manager or Enqueuer to handle this
  • queue - Name of queue to use
  • worker - Worker module to target
  • args - Array of args to send to worker
  • options - job options, for example [max_retries: `Integer`]

Returns:

  • {:ok, jid} if the job was enqueued successfully, with jid = Job ID.
  • {:error, reason} if there was an error enqueueing job
enqueue(pid, from, queue, worker, args)
enqueue(pid, from, queue, worker, args, options)
enqueue_at(pid, queue, time, worker, args)

Schedule a job to be enqueued at a specific time in the future.

Expected args:

  • pid - PID for Exq Manager or Enqueuer to handle this
  • queue - name of queue to use
  • time - Time to enqueue
  • worker - Worker module to target
  • args - Array of args to send to worker
  • options - job options, for example [max_retries: `Integer`]
enqueue_at(pid, from, queue, time, worker, args)
enqueue_at(pid, from, queue, time, worker, args, options)
enqueue_in(pid, queue, offset, worker, args)

Schedule a job to be enqueued at in the future given by offset in milliseconds.

Expected args:

  • pid - PID for Exq Manager or Enqueuer to handle this
  • queue - Name of queue to use
  • offset - Offset in seconds in the future to enqueue
  • worker - Worker module to target
  • args - Array of args to send to worker
  • options - job options, for example [max_retries: `Integer`]
enqueue_in(pid, from, queue, offset, worker, args)
enqueue_in(pid, from, queue, offset, worker, args, options)
start(type, args)

Callback implementation for c:Application.start/2.

start_link(opts \\ [])
subscribe(pid, queue)

Subscribe to a queue - ie. listen to queue for jobs

  • pid - PID for Exq Manager or Enqueuer to handle this
  • queue - Name of queue
  • concurrency - Optional argument specifying max concurrency for queue
subscribe(pid, queue, concurrency)
unsubscribe(pid, queue)

Unsubscribe from a queue - ie. stop listening to queue for jobs

  • pid - PID for Exq Manager or Enqueuer to handle this
  • queue - Name of queue
worker_job(name \\ nil, pid \\ self())

Get the job metadata

  • name - registered name of Exq. Only necessary if the custom name option is used when starting Exq. Defaults to Exq
  • pid - pid of the worker. Defaults to self().