railway_ipc v0.2.5 RailwayIpc.StreamBehaviour behaviour

Link to this section Summary

Link to this section Callbacks

Link to this callback

ack(channel, deliver_tag)

ack(channel :: map(), deliver_tag :: binary()) :: any()
Link to this callback

bind_queue(channel, %{})

bind_queue(channel :: map(), %{
  exchange: binary(),
  queue: binary(),
  consumer: binary()
}) :: :ok | {:error, any()}
Link to this callback

close_connection(connection)

close_connection(connection :: map() | nil) :: any()
Link to this callback

connect()

connect() :: {:ok, %{connection: map(), channel: map()}} | {:error, any()}
Link to this callback

consume(channel, queue)

consume(channel :: map(), queue :: String.t()) ::
  {:ok, consumer_tag :: binary()}
Link to this callback

consume(channel, queue, consumer, options)

consume(
  channel :: map(),
  queue :: String.t(),
  consumer :: pid(),
  options :: Keyword.t()
) :: {:ok, consumer_tag :: binary()}
Link to this callback

create_queue(channel, queue_name, opts)

create_queue(channel :: map(), queue_name :: String.t(), opts :: list()) ::
  {:ok, map()}
Link to this callback

direct_publish(channel, queue, message)

direct_publish(channel :: map(), queue :: binary(), message :: map()) ::
  any()
Link to this callback

get_channel(connection)

get_channel(connection :: map()) :: {:ok, channel :: map()} | {:error, any()}
Link to this callback

get_channel_from_cache(connection, channels, consumer_module)

get_channel_from_cache(
  connection :: map(),
  channels :: map(),
  consumer_module :: module()
) :: {:ok, channel_cache :: map(), channel :: map()}
Link to this callback

maybe_bind_queue(channel, queue, exchange)

maybe_bind_queue(channel :: map(), queue :: String.t(), exchange :: String.t()) ::
  any()
Link to this callback

maybe_create_exchange(channel, exchange_name)

maybe_create_exchange(channel :: map(), exchange_name :: String.t()) :: any()
Link to this callback

publish(channel, exchange, message)

publish(channel :: map(), exchange :: binary(), message :: map()) :: any()
Link to this callback

setup_exchange_and_queue(channel, exchange, queue)

setup_exchange_and_queue(
  channel :: Struct.t(),
  exchange :: binary(),
  queue :: binary()
) :: :ok