Cizen.Effect behaviour (Cizen v0.18.1) View Source
The effect behaviour.
Example
defmodule Repeat do
use Cizen.Effect
use Cizen.Effects, only: [Chain]
defstruct [:count, :effect, :pid]
@impl true
def expand(id, %__MODULE__{count: count, effect: effect, pid: pid}) do
effects =
[effect]
|> Stream.cycle()
|> Enum.take(count)
%Chain{
effects: effects
}
end
end
Link to this section Summary
Link to this section Types
Specs
alias_of() :: {:alias_of, t()}
Specs
consume() :: {:consume, term()}
Specs
handler() :: Cizen.SagaID.t()
Specs
resolve() :: {:resolve, term()}
Specs
t() :: struct()