Kvasir.Source behaviour (kvasir v0.0.15) View Source

Link to this section Summary

Link to this section Callbacks

Specs

child_spec(name :: atom(), opts :: Keyword.t()) :: false | map()
Link to this callback

commit(name, arg2, arg3)

View Source

Specs

commit(name :: atom(), Kvasir.Topic.t(), Kvasir.Event.t()) ::
  {:ok, Kvasir.Event.t()} | {:error, atom()}
Link to this callback

contains?(name, arg2, arg3)

View Source

Specs

contains?(name :: atom(), Kvasir.topic(), Kvasir.Offset.t()) ::
  :maybe | true | false
Link to this callback

generate_dedicated_publisher(name, target, arg3, opts)

View Source

Specs

generate_dedicated_publisher(
  name :: atom(),
  target :: module(),
  Kvasir.Topic.t(),
  opts :: Keyword.t()
) :: :ok | {:error, atom()}
Link to this callback

listen(name, arg2, callback, opts)

View Source

Specs

listen(
  name :: atom(),
  Kvasir.topic(),
  callback :: (Kvasir.Event.t() -> :ok | {:error, reason :: atom()}),
  opts :: Kvasir.EventSource.stream_opts()
) :: :ok | {:error, atom()}
Link to this callback

stream(name, arg2, opts)

View Source

Specs

stream(name :: atom(), Kvasir.topic(), opts :: Kvasir.EventSource.stream_opts()) ::
  {:ok, Stream.t()} | {:error, atom()}
Link to this callback

subscribe(name, arg2, opts)

View Source

Specs

subscribe(
  name :: atom(),
  Kvasir.topic(),
  opts :: Kvasir.EventSource.stream_opts()
) :: {:ok, pid()} | {:error, atom()}