Rill v0.10.4 Rill.MessageStore.Database behaviour View Source

Link to this section Summary

Link to this section Types

Link to this type

get_opts() View Source
get_opts() ::
  {:position, non_neg_integer()}
  | {:batch_size, pos_integer()}
  | {:condition, term()}

Link to this type

put_opts() View Source
put_opts() ::
  {:expected_version, Rill.MessageStore.ExpectedVersion.t()}
  | {:identifier_get, (() -> String.t()) | nil}

Link to this section Callbacks

Link to this callback

get(session, stream_name, opts) View Source
get(
  session :: Rill.Session.t(),
  stream_name :: Rill.MessageStore.StreamName.t(),
  opts :: [get_opts()]
) :: [
  %Rill.MessageStore.MessageData.Read{
    data: term(),
    global_position: term(),
    id: term(),
    metadata: term(),
    position: term(),
    stream_name: term(),
    time: term(),
    type: term()
  }
]

Link to this callback

get_last(session, stream_name) View Source
get_last(
  session :: Rill.Session.t(),
  stream_name :: Rill.MessageStore.StreamName.t()
) ::
  %Rill.MessageStore.MessageData.Read{
    data: term(),
    global_position: term(),
    id: term(),
    metadata: term(),
    position: term(),
    stream_name: term(),
    time: term(),
    type: term()
  }
  | nil

Link to this callback

put(session, msg, stream_name, opts) View Source
put(
  session :: Rill.Session.t(),
  msg :: %Rill.MessageStore.MessageData.Write{
    data: term(),
    id: term(),
    metadata: term(),
    type: term()
  },
  stream_name :: Rill.MessageStore.StreamName.t(),
  opts :: [put_opts()]
) :: non_neg_integer()