kvasir v0.0.4 Kvasir.Source behaviour View Source

Link to this section Summary

Link to this section Callbacks

Link to this callback

child_spec(name, opts)

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

commit(name, arg2, arg3)

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

contains?(name, arg2, arg3)

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

listen(name, arg2, callback, opts)

View Source
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

publish(name, arg2, arg3)

View Source
publish(name :: atom(), Kvasir.topic(), Kvasir.Event.t()) ::
  :ok | {:error, atom()}
Link to this callback

stream(name, arg2, opts)

View Source
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
subscribe(
  name :: atom(),
  Kvasir.topic(),
  opts :: Kvasir.EventSource.stream_opts()
) :: {:ok, pid()} | {:error, atom()}