Telegex.Plug v0.2.2 Telegex.Plug.Pipeline View Source
Plug pipeline.
Cache plug modules in preset categories, and call plug in the pipeline in order.
Link to this section Summary
Functions
Call all plugs in the pipeline.
Get a list of plugs whose preset category is caller
.
Returns a specification to start this module under a supervisor.
Get a list of plugs whose preset category is commander
.
Get a list of plugs whose preset category is handler
.
Install a plug into the pipeline.
Install multiple plugs into the pipeline.
Get a list of plugs whose preset category is preheater
.
Uninstall a plug in the pipeline.
Link to this section Types
Link to this section Functions
Specs
call(Telegex.Model.Update.t(), Telegex.Plug.state()) :: [snapshot()]
Call all plugs in the pipeline.
This function always keeps the calling order of commanders
=> handlers
-> caller
. The state of the previous call result will be used before the stateful Plug is called.
At the same time, this function will return all the call results of Plug, which are stored in order in a list.
Specs
callers() :: [atom()]
Get a list of plugs whose preset category is caller
.
Returns a specification to start this module under a supervisor.
See Supervisor
.
Specs
commanders() :: [atom()]
Get a list of plugs whose preset category is commander
.
Specs
handlers() :: [atom()]
Get a list of plugs whose preset category is handler
.
Specs
install(plug(), install_opts()) :: :ok | :already_installed
Install a plug into the pipeline.
Arguments
plug
: The name of the module that implements the plug.options
can_repeat
: Whether to allow repeated installation. The default value isfalse
, and repeated installation is not allowed.
Notes: If the value of the optional parameter can_repeat
is false
but an existing plug is installed, it will return :already_installed
.
Install multiple plugs into the pipeline.
Arguments
plugs
: List ofplug()
.options
: Refer to theoptions
parameter in theTelegex.Pipeline.install/2
function.
Specs
preheaters() :: [atom()]
Get a list of plugs whose preset category is preheater
.
Uninstall a plug in the pipeline.