Cizen v0.5.0 Cizen.SagaRegistry View Source

A key-value saga storage.

It works like Registry.

Link to this section Summary

Link to this section Types

Link to this section Functions

Link to this function dispatch(registry, key, mfa_or_fun, opts \\ []) View Source
dispatch(registry(), key(), dispatcher(), keyword()) :: :ok
Link to this function lookup(registry, key) View Source
lookup(registry(), key()) :: [entry()]
Link to this function put_meta(registry, key, value) View Source
Link to this function register(registry, saga_id, key, value) View Source
register(registry(), Cizen.SagaID.t(), key(), value()) ::
  {:ok, pid()}
  | {:error, {:already_registered, Cizen.SagaID.t()}}
  | {:error, :no_saga}
Link to this function unregister(registry, saga_id, key) View Source
unregister(registry(), Cizen.SagaID.t(), key()) :: :ok | {:error, :no_saga}
Link to this function update_value(registry, saga_id, key, callback) View Source
update_value(registry(), Cizen.SagaID.t(), key(), (value() -> value())) ::
  {new_value :: term(), old_value :: term()} | {:error, :no_saga}