View Source RabbitMQStream.Connection.Behavior behaviour (rabbitmq_stream v0.4.1)
Defines the interface a Connection Module that interacts with the Streams Protocol TCP/TLS API.
Summary
Callbacks
@callback close(GenServer.server(), reason :: String.t(), code :: integer()) :: :ok | {:error, reason :: atom()}
@callback connect(GenServer.server()) :: :ok | {:error, reason :: atom()}
@callback create_stream( GenServer.server(), stream_name :: String.t(), arguments :: keyword(String.t()) | nil ) :: :ok | {:error, reason :: atom()}
@callback credit( GenServer.server(), subscription_id :: non_neg_integer(), credit :: non_neg_integer() ) :: :ok
@callback declare_producer( GenServer.server(), stream_name :: String.t(), producer_reference :: String.t() ) :: {:ok, producer_id :: integer()} | {:error, reason :: atom()}
@callback delete_producer(GenServer.server(), producer_id :: integer()) :: :ok | {:error, reason :: atom()}
@callback delete_stream(GenServer.server(), stream_name :: String.t()) :: :ok | {:error, reason :: atom()}
@callback delete_super_stream(GenServer.server(), name :: String.t()) :: :ok | {:error, reason :: atom()}
@callback partitions(GenServer.server(), super_stream :: String.t()) :: {:ok, partitions :: RabbitMQStream.Message.Types.PartitionsQueryResponseData.t()} | {:error, reason :: atom()}
Link to this callback
publish(server, producer_id, publishing_id, message, filter_value)
View Source@callback publish( GenServer.server(), producer_id :: integer(), publishing_id :: integer(), message :: binary(), filter_value :: binary() | nil ) :: :ok
@callback query_metadata(GenServer.server(), streams :: [String.t()]) :: {:ok, metadata :: RabbitMQStream.Message.Types.QueryMetadataResponseData.t()} | {:error, reason :: atom()}
@callback query_offset( GenServer.server(), stream_name :: String.t(), offset_reference :: String.t() ) :: {:ok, offset :: integer()} | {:error, reason :: atom()}
@callback query_producer_sequence(GenServer.server(), String.t(), String.t()) :: {:ok, sequence :: integer()} | {:error, reason :: atom()}
@callback respond( GenServer.server(), request :: RabbitMQStream.Message.Request.t(), opts :: Keyword.t() ) :: :ok
@callback route(GenServer.server(), routing_key :: String.t(), super_stream :: String.t()) :: :ok | {:error, reason :: atom()}
@callback store_offset( GenServer.server(), stream_name :: String.t(), offset_reference :: String.t(), offset :: integer() ) :: :ok
@callback stream_stats(GenServer.server(), stream_name :: String.t()) :: {:ok, stats :: RabbitMQStream.Message.Types.StreamStatsResponseData.t()} | {:error, reason :: atom()}
@callback subscribe( GenServer.server(), stream_name :: String.t(), pid :: pid(), offset :: RabbitMQStream.Connection.offset(), credit :: non_neg_integer(), properties :: Keyword.t() ) :: {:ok, subscription_id :: non_neg_integer()} | {:error, reason :: atom()}
@callback supports?(GenServer.server(), command :: atom()) :: boolean()
@callback supports?(GenServer.server(), command :: atom(), version :: String.t()) :: boolean()
@callback unsubscribe(GenServer.server(), subscription_id :: non_neg_integer()) :: :ok | {:error, reason :: atom()}