piper v0.0.4 Piper behaviour
The pipeline specification.
Function pipes
Pipe can be any fuction that receives data and set of options and returns data. It’s type signature must be:
(Piper.Data.t, Piper.opts) :: Piper.Data.t
Module pipes
A module pipe is extension of fuction pipe. It is module that must export:
- a
call2
function with signature defined above - an
init1
which takes a set of options and initializes it.
The result returned by init/1
is passed as second argument to call/2
. Note
that init/1
may be called during compilation and as such it must not return
pids, ports or values that are not specific to the runtime.
The API expected by a module plug is defined as a behaviour by the Piper
module (this module).