Kombu.Binding (Kombu v0.1.0)

Copy Markdown View Source

Represents a queue or exchange binding (kombu.entity.binding).

Summary

Functions

Converts the binding to a map representation.

Binds an entity (%Kombu.Queue{} or %Kombu.Exchange{}) using this binding.

Checks if the binding is bound to a channel.

Checks if the declaration can be cached.

Declares the target exchange on channel if binding.exchange is present.

Creates a new %Kombu.Binding{}.

Creates a new %Kombu.Binding{} with exchange, routing_key, and additional opts.

Unbinds an entity (%Kombu.Queue{} or %Kombu.Exchange{}) from this binding.

Types

t()

@type t() :: %Kombu.Binding{
  arguments: map() | nil,
  exchange: Kombu.Exchange.t() | nil,
  routing_key: String.t(),
  unbind_arguments: map() | nil
}

Functions

as_dict(binding, opts \\ [])

@spec as_dict(t(), keyword()) :: map()

Converts the binding to a map representation.

bind(binding, entity, opts \\ [])

@spec bind(t(), struct(), keyword()) :: :ok

Binds an entity (%Kombu.Queue{} or %Kombu.Exchange{}) using this binding.

bound?(binding)

@spec bound?(t()) :: boolean()

Checks if the binding is bound to a channel.

can_cache_declaration?(binding)

@spec can_cache_declaration?(t()) :: boolean()

Checks if the declaration can be cached.

declare(binding, channel, opts)

@spec declare(t(), pid() | nil, keyword()) :: :ok

Declares the target exchange on channel if binding.exchange is present.

new(exchange \\ nil, opts \\ [])

@spec new(Kombu.Exchange.t() | String.t() | nil, keyword()) :: t()

Creates a new %Kombu.Binding{}.

new(exchange, routing_key, opts)

@spec new(Kombu.Exchange.t() | String.t() | nil, String.t(), keyword()) :: t()

Creates a new %Kombu.Binding{} with exchange, routing_key, and additional opts.

unbind(binding, entity, opts \\ [])

@spec unbind(t(), struct(), keyword()) :: :ok

Unbinds an entity (%Kombu.Queue{} or %Kombu.Exchange{}) from this binding.