Core.Workers.JobQueue (Elixir Server Core v0.1.1)

Copy Markdown View Source

Summary

Functions

Get all jobs in the queue

Returns a specification to start this module under a supervisor.

Claim the next available job for processing. Marks it as :running and returns it to the worker.

Get a specific job by ID

Mark a job as completed with a result

Mark a job as failed with an error reason

Submit a new job to the queue. Returns synchronously with the assigned job id.

Submit a job to run at a specific future time. The job is persisted immediately but enters the in-memory queue only at run_at.

Functions

all(opts \\ [])

Get all jobs in the queue

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

claim_next()

Claim the next available job for processing. Marks it as :running and returns it to the worker.

get(id)

Get a specific job by ID

mark_done(id, result)

Mark a job as completed with a result

mark_failed(id, reason)

Mark a job as failed with an error reason

start_link(opts \\ [])

stats()

submit(payload, opts \\ [])

Submit a new job to the queue. Returns synchronously with the assigned job id.

submit_at(payload, run_at, opts \\ [])

Submit a job to run at a specific future time. The job is persisted immediately but enters the in-memory queue only at run_at.