Cizen.SagaRegistry (Cizen v0.18.1) View Source

A key-value saga storage.

It works like Registry.

Link to this section Summary

Link to this section Types

Specs

dispatcher() :: ([entry()] -> term()) | {module(), atom(), [any()]}

Specs

entry() :: {Cizen.SagaID.t(), value()}

Specs

guards() :: Registry.guards()

Specs

key() :: Registry.key()

Specs

registry() :: Registry.registry()

Specs

value() :: Registry.value()

Link to this section Functions

See Registry.child_spec/1.

See Registry.count/1.

Link to this function

dispatch(registry, key, mfa_or_fun, opts \\ [])

View Source

Specs

dispatch(registry(), key(), dispatcher(), keyword()) :: :ok

Specs

keys(registry(), Cizen.SagaID.t()) :: [value()]

Specs

lookup(registry(), key()) :: [entry()]

See Registry.meta/2.

Link to this function

put_meta(registry, key, value)

View Source

See Registry.put_meta/3.

Link to this function

register(registry, saga_id, key, value)

View Source

Specs

register(registry(), Cizen.SagaID.t(), key(), value()) ::
  {:ok, pid()}
  | {:error, {:already_registered, Cizen.SagaID.t()}}
  | {:error, :no_saga}

See Registry.start_link/1.

Link to this function

unregister(registry, saga_id, key)

View Source

Specs

unregister(registry(), Cizen.SagaID.t(), key()) :: :ok | {:error, :no_saga}
Link to this function

update_value(registry, saga_id, key, callback)

View Source

Specs

update_value(registry(), Cizen.SagaID.t(), key(), (value() -> value())) ::
  {new_value :: term(), old_value :: term()} | {:error, :no_saga}