Exq.Middleware.Pipeline (exq v0.19.0) View Source

Pipeline is a structure that is used as an argument in functions of module with Exq.Middleware.Behaviour behaviour.

This structure must be returned by particular function to be used in the next middleware based on defined middleware chain.

Pipeline contains the following options:

  • assigns - map that contains shared data across the whole job lifecycle
  • worker_pid - process id of Exq.Worker.Server
  • event - name of current middleware function, possible values are: before_work, after_processed_work and after_failed_work
  • halted - flag indicating whether pipeline was halted, defaults to false
  • terminated - flag indicating whether worker and pipeline were halted, If the flag was set to true, the job will not be dispatched and all after_*_work/1 will be skipped. For each specific middleware:
    • Exq.Middleware.Job: Will NOT remove the backup from job queue
    • Exq.Middleware.Logger: Will NOT record job as done or failed with timestamp
    • Exq.Middleware.Manager: Will NOT update worker counter
    • Exq.Middleware.Unique: Will NOT clear unique lock
    • Exq.Middleware.Stats: Will NOT remove job from processes queue

Link to this section Summary

Functions

Puts the key with value equal to value into assigns map

Implements middleware chain: sequential call of function with pipeline.event name inside module module

Sets halted to true

Sets terminated to true

Link to this section Functions

Link to this function

assign(pipeline, key, value)

View Source

Puts the key with value equal to value into assigns map

Link to this function

assign_worker_state(pipeline, worker_state)

View Source

Puts a state of Exq.Worker.Server into assigns map

Implements middleware chain: sequential call of function with pipeline.event name inside module module

Sets halted to true

Sets terminated to true