View Source Actors.Actor.StateManager (spawn v1.0.0-rc.22)

StateManager Implements behavior that allows an Actor's state to be saved to persistent storage using database drivers.

Summary

Functions

Link to this function

is_new?(old_hash, new_state)

View Source
@spec load(Eigr.Functions.Protocol.Actors.ActorId.t()) :: {:ok, any()}
Link to this function

load(actor_id, revision)

View Source
@spec load(Eigr.Functions.Protocol.Actors.ActorId.t(), number()) :: {:ok, any()}
@spec load_all(Eigr.Functions.Protocol.Actors.ActorId.t()) ::
  {:ok, term()} | :not_found | {:error, term()}
Link to this function

load_by_interval(actor_id, time_start, time_end)

View Source
@spec load_by_interval(
  Eigr.Functions.Protocol.Actors.ActorId.t(),
  String.t(),
  String.t()
) ::
  {:ok, term()} | :not_found | {:error, term()}
Link to this function

save(actor_id, state, opts)

View Source
@spec save(
  Eigr.Functions.Protocol.Actors.ActorId.t(),
  Eigr.Functions.Protocol.Actors.ActorState.t(),
  Keyword.t()
) ::
  {:ok, Eigr.Functions.Protocol.Actors.ActorState.t()}
  | {:error, any(), Eigr.Functions.Protocol.Actors.ActorState.t()}
Link to this function

save_async(actor_id, state, opts \\ [])

View Source
@spec save_async(
  Eigr.Functions.Protocol.Actors.ActorId.t(),
  Eigr.Functions.Protocol.Actors.ActorState.t(),
  Keyword.t()
) ::
  {:ok, Eigr.Functions.Protocol.Actors.ActorState.t()}
  | {:error, any(), Eigr.Functions.Protocol.Actors.ActorState.t()}