Cizen v0.10.0 Cizen.SagaFilter behaviour View Source

A behaviour module to define an event filter.

Link to this section Summary

Link to this section Types

Link to this section Functions

Link to this macro defsagafilter(module, key) View Source (macro)

Defines a event body filter.

Example

defmodule SomeSaga do
  defstruct [:key, :value]
  import Cizen.SagaFilter
  defsagafilter KeyFilter, :key
  defsagafilter ValueFilter, :value do
    @moduledoc "Some document"
  end

  @behaviour Cizen.Saga
  defstruct []

  @impl true
  def init(_id, _saga) do
    :ok
  end

  @impl true
  def handle_event(_id, _event, state) do
    state
  end
end
Link to this macro defsagafilter(module, key, list) View Source (macro)

Link to this section Callbacks