View Source Kvasir.Source behaviour (kvasir v0.0.18)
Link to this section Summary
Link to this section Callbacks
@callback commit(name :: atom(), Kvasir.Topic.t(), Kvasir.Event.t()) :: {:ok, Kvasir.Event.t()} | {:error, atom()}
@callback contains?(name :: atom(), Kvasir.topic(), Kvasir.Offset.t()) :: :maybe | true | false
@callback generate_dedicated_publisher( name :: atom(), target :: module(), Kvasir.Topic.t(), opts :: Keyword.t() ) :: :ok | {:error, atom()}
@callback listen( name :: atom(), Kvasir.topic(), callback :: (Kvasir.Event.t() -> :ok | {:error, reason :: atom()}), opts :: Kvasir.EventSource.stream_opts() ) :: :ok | {:error, atom()}
@callback stream(name :: atom(), Kvasir.topic(), opts :: Kvasir.EventSource.stream_opts()) :: {:ok, Stream.t()} | {:error, atom()}
@callback subscribe( name :: atom(), Kvasir.topic(), opts :: Kvasir.EventSource.stream_opts() ) :: {:ok, pid()} | {:error, atom()}