Crosswake.Offline.Runtime (crosswake v0.2.4)

View Source

Executable runtime contract for cached hydration and the study-session island.

Summary

Functions

activate(lifecycle, scope_ref)

@spec activate(Crosswake.Offline.Runtime.Lifecycle.t(), String.t()) ::
  {:ok, Crosswake.Offline.Runtime.Lifecycle.t()} | {:error, :scope_inactive}

cached_hydration(contract)

@spec cached_hydration(Crosswake.Offline.Contracts.CacheRoute.t()) ::
  Crosswake.Offline.Runtime.CachedHydration.t()

drain(entries, admit)

@spec drain([term()], (term() -> :accepted | :rejected | :conflict | :blocked)) ::
  {:complete | :halted, [term()]}

fence(lifecycle)

@spec fence(Crosswake.Offline.Runtime.Lifecycle.t()) ::
  Crosswake.Offline.Runtime.Lifecycle.t()

lease(lifecycle, scope_ref, epoch)

@spec lease(Crosswake.Offline.Runtime.Lifecycle.t(), String.t(), non_neg_integer()) ::
  {:ok, %{scope_ref: String.t(), epoch: non_neg_integer()}}
  | {:error, :scope_inactive | :stale_lease}

new_lifecycle()

@spec new_lifecycle() :: Crosswake.Offline.Runtime.Lifecycle.t()

queue_entry(study_session, entry)

@spec queue_entry(
  Crosswake.Offline.Runtime.StudySession.t(),
  Crosswake.Offline.Journal.Entry.t()
) ::
  {:ok, Crosswake.Offline.Journal.Entry.t()}

study_session(contract)

@spec study_session(Crosswake.Offline.Contracts.StudySessionIsland.t()) ::
  Crosswake.Offline.Runtime.StudySession.t()