Kvasir.Agent.Cache behaviour (kvasir_agent v0.0.7) View Source

Link to this section Summary

Link to this section Types

Link to this section Callbacks

Link to this callback

cache(agent, partition, id)

View Source

Specs

cache(agent :: module(), partition :: non_neg_integer(), id :: term()) ::
  {:ok, ref()}

Specs

delete(ref()) :: :ok | {:error, atom()}
Link to this callback

init(agent, partition, opts)

View Source

Specs

init(agent :: module(), partition :: non_neg_integer(), opts :: Keyword.t()) ::
  :ok | {:ok, map()}

Specs

load(ref()) ::
  {:ok, Kvasir.Offset.t(), map()} | :no_previous_state | {:error, atom()}
Link to this callback

save(cache, data, offset)

View Source

Specs

save(cache :: ref(), data :: map(), offset :: Kvasir.Offset.t()) ::
  :ok | {:error, atom()}

Specs

stream(agent :: module()) :: Stream.t()

Specs

track_command(ref()) :: :ok | {:error, atom()}