Que v0.2.0 Que.Job

Summary

Types

One of the atoms in [:queued, :started, :failed, :completed]

Functions

Handles Job Failure, Calls appropriate worker method and updates the job status to :failed

Handles Job Success, Calls appropriate worker method and updates the job status to :completed

Returns a new Job struct with defaults

Updates the Job struct with new status and spawns & monitors a new Task under the TaskSupervisor which executes the perform method with supplied arguments

Update the Job status to one of the predefined values in @statuses

Types

status()
status() :: atom

One of the atoms in [:queued, :started, :failed, :completed]

Functions

handle_failure(job, err)

Handles Job Failure, Calls appropriate worker method and updates the job status to :failed

handle_success(job)

Handles Job Success, Calls appropriate worker method and updates the job status to :completed

new(worker, args \\ nil)

Returns a new Job struct with defaults

perform(job)

Updates the Job struct with new status and spawns & monitors a new Task under the TaskSupervisor which executes the perform method with supplied arguments

set_status(job, status)

Update the Job status to one of the predefined values in @statuses