toniq v1.2.3 Toniq.JobPersistence

Summary

Functions

add_vm_identifier(job, identifier)
delayed_jobs(identifier \\ default_identifier())

Returns all delayed jobs.

delayed_jobs_key(identifier)
delete_failed_job(job)

Deletes a failed job.

Uses “job.vm” to do the operation in the correct namespace.

failed_jobs(identifier \\ default_identifier())

Returns all failed jobs.

failed_jobs_key(identifier)
incoming_jobs(identifier \\ default_identifier())

Returns all incoming jobs (used for failover).

incoming_jobs_key(identifier)
jobs(identifier \\ default_identifier())

Returns all jobs that has not yet finished or failed.

jobs_key(identifier)
mark_as_failed(job, error, identifier \\ default_identifier())

Marks a job as failed. This removes the job from the regular list and stores it in the failed jobs list.

mark_as_successful(job, identifier \\ default_identifier())

Marks a job as finished. This means that it’s deleted from redis.

move_delayed_job_to_incoming_jobs(delayed_job)

Moves a delayed job to the regular jobs list.

Uses “job.vm” to do the operation in the correct namespace.

move_failed_job_to_incomming_jobs(job_with_error)

Moves a failed job to the regular jobs list.

Uses “job.vm” to do the operation in the correct namespace.

remove_from_incoming_jobs(job)
store_delayed_job(worker_module, arguments, options, identifier \\ default_identifier())

Stores a delayed job in redis.

store_incoming_job(worker_module, arguments, identifier \\ default_identifier())
store_job(worker_module, arguments, identifier \\ default_identifier())

Stores a job in redis. If it does not succeed it will fail right away.

strip_vm_identifier(job)