commanded v0.10.0 Commanded.Middleware.Pipeline

Pipeline is a struct used as an argument in the callback functions of modules implementing the Commanded.Middleware behaviour.

This struct must be returned by each function to be used in the next middleware based on the configured middleware chain.

Pipeline fields

  • assigns - shared user data as a map
  • command - the command struct being dispatched
  • halted - the boolean status on whether the pipeline was halted
  • response - override the response to send back to the caller (optional)

Summary

Functions

Puts the key with value equal to value into assigns map

Executes the middleware chain

Halts the pipeline by preventing further middleware downstream from being invoked

Sets the response to be returned to the dispatch caller

Functions

assign(pipeline, key, value)

Puts the key with value equal to value into assigns map

chain(pipeline, stage, middleware)

Executes the middleware chain

halt(pipeline)

Halts the pipeline by preventing further middleware downstream from being invoked.

Prevents dispatch of the command if halt occurs in a before_dispatch callback.

respond(pipeline, response)

Sets the response to be returned to the dispatch caller