toniq v1.0.8 Toniq.JobPersistence

Summary

Functions

Deletes a failed job

Returns all incoming jobs (used for failover)

Returns all jobs that has not yet finished or failed

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

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

Moves a failed job to the regular jobs list

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

Functions

add_vm_identifier(job, 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_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_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)