AMQP.Channel (amqp v3.0.0) View Source

Functions to operate on Channels.

Link to this section Summary

Functions

Closes an open Channel.

Opens a new Channel in a previously opened Connection.

Link to this section Types

Specs

custom_consumer() :: {module(), args :: any()}

Specs

t() :: %AMQP.Channel{
  conn: AMQP.Connection.t(),
  custom_consumer: custom_consumer() | nil,
  pid: pid()
}

Link to this section Functions

Specs

close(t()) :: :ok | {:error, AMQP.Basic.error()}

Closes an open Channel.

Link to this function

open(conn, custom_consumer \\ {SelectiveConsumer, self()})

View Source

Specs

open(AMQP.Connection.t(), custom_consumer() | nil) ::
  {:ok, t()} | {:error, any()}

Opens a new Channel in a previously opened Connection.

Allows optionally to pass a custom_consumer/0 to start a custom consumer implementation. The consumer must implement the :amqp_gen_consumer behavior from :amqp_client. See :amqp_connection.open_channel/2 for more details and AMQP.DirectConsumer for an example of a custom consumer.