avrora v0.11.0 Avrora.Storage.Transient behaviour View Source

Storage behavior which allows keys to be removed or expired.

Link to this section Summary

Types

Naive timestamp with second precision.

Link to this section Types

Link to this type

timestamp()

View Source
timestamp() :: timeout()

Naive timestamp with second precision.

Link to this section Callbacks

Link to this callback

delete(key)

View Source
delete(key :: Avrora.Storage.schema_id()) ::
  {:ok, result :: boolean()} | {:error, reason :: term()}
Link to this callback

expire(key, ttl)

View Source
expire(key :: Avrora.Storage.schema_id(), ttl :: timeout()) ::
  {:ok, timestamp :: timestamp()} | {:error, reason :: term()}
Link to this callback

flush()

View Source
flush() :: {:ok, result :: boolean()} | {:error, reason :: term()}