ASM.History (ASM v0.9.2)

Copy Markdown View Source

Replay and rebuild helpers on top of ASM.Store.

Summary

Functions

rebuild_run(store, session_id, run_id)

@spec rebuild_run(pid(), String.t(), String.t()) ::
  {:ok,
   %{state: ASM.Run.State.t(), result: ASM.Result.t(), events: [ASM.Event.t()]}}
  | {:error, ASM.Error.t()}

replay_session(store, session_id, initial_state, reducer)

@spec replay_session(pid(), String.t(), term(), (term(), ASM.Event.t() -> term())) ::
  {:ok, term()} | {:error, ASM.Error.t()}