Exq.Api (exq v0.19.0) View Source

Interface for retrieving Exq stats.

Pid is currently Exq.Api process.

Link to this section Summary

Functions

Number of busy workers

Re Enqueue jobs from dead queue.

Re enqueue jobs from retry queue immediately.

Enqueue jobs from scheduled queue immediately.

List jobs that have failed and will not retry, as they've exceeded their retry count.

Number of jobs that have failed and exceeded their retry count.

List jobs enqueued

List jobs enqueued

List of worker nodes currently running

List of processes currently running

A count of the number of jobs in the queue, for each queue.

A count of the number of jobs in the queue, for a provided queue.

List of queues with jobs (empty queues are deleted).

Removes a job from the queue specified.

Removes a job in the queue of jobs that have failed and exceeded their retry count.

Removes jobs from dead queue.

Removes a job from the queue specified.

Clear / Remove queue

Removes a job in the retry queue from being enqueued again.

Removes jobs from retry queue.

Removes a job scheduled to run in the future from being enqueued.

Removes jobs from scheduled queue.

List jobs that will be retried because they previously failed and have not exceeded their retry_count.

Number of jobs in the retry queue.

List jobs that are enqueued and scheduled to be run at a future time.

Number of scheduled jobs enqueued.

List jobs that are enqueued and scheduled to be run at a future time, along with when they are scheduled to run.

Send signal to the given node.

Return stat for given key.

Link to this section Functions

Number of busy workers

Expected args:

  • pid - Exq.Api process

Returns:

  • {:ok, num_busy} - number of busy workers
Link to this function

dequeue_failed_jobs(pid, raw_jobs)

View Source

Re Enqueue jobs from dead queue.

Expected args:

  • pid - Exq.Api process
  • raw_job - raw json encoded job value

Returns:

  • {:ok, num_enqueued}
Link to this function

dequeue_retry_jobs(pid, raw_jobs)

View Source

Re enqueue jobs from retry queue immediately.

Expected args:

  • pid - Exq.Api process
  • raw_job - raw json encoded job value

Returns:

  • {:ok, num_enqueued}
Link to this function

dequeue_scheduled_jobs(pid, raw_jobs)

View Source

Enqueue jobs from scheduled queue immediately.

Expected args:

  • pid - Exq.Api process
  • raw_job - raw json encoded job value

Returns:

  • {:ok, num_enqueued}
Link to this function

failed(pid, options \\ [])

View Source

List jobs that have failed and will not retry, as they've exceeded their retry count.

Expected args:

  • pid - Exq.Api process
  • options
    • score: (boolean) whether to include job score
    • size: (integer) size of list
    • offset: (integer) start offset of the list

Returns:

  • {:ok, [jobs]}

Number of jobs that have failed and exceeded their retry count.

Expected args:

  • pid - Exq.Api process

Returns:

  • {:ok, num_failed} - number of failed jobs
This function is deprecated. use find_failed/4.
Link to this function

find_failed(pid, score, jid, options \\ [])

View Source

Find failed job

Expected args:

  • pid - Exq.Api process
  • score - Job score
  • jid - Job jid
  • options
    • raw: (boolean) whether to deserialize the job

Returns:

  • {:ok, job}
Link to this function

find_job(pid, queue, jid)

View Source
This function is deprecated. use find_retry/4.
Link to this function

find_retry(pid, score, jid, options \\ [])

View Source

Find job in retry queue

Expected args:

  • pid - Exq.Api process
  • score - Job score
  • jid - Job jid
  • options
    • raw: (boolean) whether to deserialize the job

Returns:

  • {:ok, job}
Link to this function

find_scheduled(pid, jid)

View Source
This function is deprecated. use find_scheduled/4.
Link to this function

find_scheduled(pid, score, jid, options \\ [])

View Source

Find job in scheduled queue

Expected args:

  • pid - Exq.Api process
  • score - Job score
  • jid - Job jid
  • options
    • raw: (boolean) whether to deserialize the job

Returns:

  • {:ok, job}

List jobs enqueued

Expected args:

  • pid - Exq.Api process

Returns:

  • {:ok, [{queue, [jobs]}, {queue, [jobs]}]}
Link to this function

jobs(pid, queue, options \\ [])

View Source

List jobs enqueued

Expected args:

  • pid - Exq.Api process
  • queue - Queue name
  • options
    • size: (integer) size of list
    • offset: (integer) start offset of the list
    • raw: (boolean) whether to deserialize the job

Returns:

  • {:ok, [jobs]}

List of worker nodes currently running

List of processes currently running

Expected args:

  • pid - Exq.Api process

Returns:

  • {:ok, [processes]}

A count of the number of jobs in the queue, for each queue.

Expected args:

  • pid - Exq.Api process

Returns:

  • {:ok, [{queue, num_jobs}, {queue, num_jobs}]}

A count of the number of jobs in the queue, for a provided queue.

Expected args:

  • pid - Exq.Api process
  • queue - The name of the queue to find the number of jobs for

Returns:

  • {:ok, num_jobs}

List of queues with jobs (empty queues are deleted).

Expected args:

  • pid - Exq.Api process

Returns:

  • {:ok, queues} - list of queue
Link to this function

remove_enqueued_jobs(pid, queue, raw_jobs)

View Source

Removes a job from the queue specified.

Expected args:

  • pid - Exq.Api process
  • queue - The name of the queue to remove the job from
  • raw_job - raw json encoded job value

Returns:

  • :ok
This function is deprecated. use remove_failed_jobs/2.

Removes a job in the queue of jobs that have failed and exceeded their retry count.

Expected args:

  • pid - Exq.Api process
  • jid - Unique identifier for the job

Returns:

  • :ok
Link to this function

remove_failed_jobs(pid, raw_jobs)

View Source

Removes jobs from dead queue.

Expected args:

  • pid - Exq.Api process
  • raw_job - raw json encoded job value

Returns:

  • :ok
Link to this function

remove_job(pid, queue, jid)

View Source
This function is deprecated. use remove_enqueued_jobs/3.

Removes a job from the queue specified.

Expected args:

  • pid - Exq.Api process
  • queue - The name of the queue to remove the job from
  • jid - Unique identifier for the job

Returns:

  • :ok
Link to this function

remove_queue(pid, queue)

View Source

Clear / Remove queue

Expected args:

  • pid - Exq.Api process
  • queue - Queue name

Returns:

  • {:ok, queues} - list of queue
This function is deprecated. use remove_retry_jobs/2.

Removes a job in the retry queue from being enqueued again.

Expected args:

  • pid - Exq.Api process
  • jid - Unique identifier for the job

Returns:

  • :ok
Link to this function

remove_retry_jobs(pid, raw_jobs)

View Source

Removes jobs from retry queue.

Expected args:

  • pid - Exq.Api process
  • raw_job - raw json encoded job value

Returns:

  • :ok
Link to this function

remove_scheduled(pid, jid)

View Source
This function is deprecated. use remove_scheduled_jobs/2.

Removes a job scheduled to run in the future from being enqueued.

Expected args:

  • pid - Exq.Api process
  • jid - Unique identifier for the job

Returns:

  • :ok
Link to this function

remove_scheduled_jobs(pid, raw_jobs)

View Source

Removes jobs from scheduled queue.

Expected args:

  • pid - Exq.Api process
  • raw_job - raw json encoded job value

Returns:

  • :ok
Link to this function

retries(pid, options \\ [])

View Source

List jobs that will be retried because they previously failed and have not exceeded their retry_count.

Expected args:

  • pid - Exq.Api process
  • options
    • score: (boolean) whether to include job score
    • size: (integer) size of list
    • offset: (integer) start offset of the list

Returns:

  • {:ok, [jobs]}

Number of jobs in the retry queue.

Expected args:

  • pid - Exq.Api process

Returns:

  • {:ok, num_retry} - number of jobs to be retried
Link to this function

scheduled(pid, options \\ [])

View Source

List jobs that are enqueued and scheduled to be run at a future time.

Expected args:

  • pid - Exq.Api process
  • options
    • score: (boolean) whether to include job score
    • size: (integer) size of list
    • offset: (integer) start offset of the list

Returns:

  • {:ok, [jobs]}

Number of scheduled jobs enqueued.

Expected args:

  • pid - Exq.Api process

Returns:

  • {:ok, num_scheduled} - number of scheduled jobs enqueued
Link to this function

scheduled_with_scores(pid)

View Source

List jobs that are enqueued and scheduled to be run at a future time, along with when they are scheduled to run.

Expected args:

  • pid - Exq.Api process

Returns:

  • {:ok, [{job, scheduled_at}]}
Link to this function

send_signal(pid, node_id, signal_name)

View Source

Send signal to the given node.

Expected args:

  • pid - Exq.Api process
  • node_id - node identifier
  • signal_name - Name of the signal.

Supported Signals

  • TSTP - unsubscibe from all queues

Returns:

  • :ok

Return stat for given key.

Examples of keys are processed and failed.

Expected args:

  • pid - Exq.Api process
  • key - Key for stat
  • queue - Queue name

Returns:

  • {:ok, stat} stat for key