Kombu.Transport.Virtual.BrokerState (Kombu v0.1.0)

Copy Markdown View Source

Holds virtual broker exchanges, bindings, and queue indices (kombu.transport.virtual.base.BrokerState).

Summary

Functions

Appends a routing table entry {routing_key, pattern, queue} to exchange.

Declares a binding (queue, exchange, routing_key) with arguments.

Deletes a binding (queue, exchange, routing_key).

Clears all exchanges, bindings, and queue indices.

Deletes an exchange from state.exchanges.

Returns true if (queue, exchange, routing_key) is bound.

Creates a new %BrokerState{}.

Puts or updates an exchange entry in state.exchanges.

Returns a list of {exchange, routing_key, arguments} tuples for queue.

Deletes all bindings for queue.

Removes meta_tuple from exchange's routing table.

Types

binding_key()

@type binding_key() :: {String.t(), String.t(), String.t()}

queue_binding()

@type queue_binding() :: {String.t(), String.t(), map() | nil}

t()

@type t() :: %Kombu.Transport.Virtual.BrokerState{
  bindings: %{required(binding_key()) => map() | nil},
  exchanges: %{required(String.t()) => map()},
  queue_index: %{required(String.t()) => MapSet.t(binding_key())}
}

Functions

append_table(state, exchange, meta_tuple)

@spec append_table(t(), String.t(), {String.t(), String.t() | nil, String.t()}) :: t()

Appends a routing table entry {routing_key, pattern, queue} to exchange.

binding_declare(state, queue, exchange, routing_key, arguments \\ nil)

@spec binding_declare(t(), String.t(), String.t(), String.t(), map() | nil) :: t()

Declares a binding (queue, exchange, routing_key) with arguments.

binding_delete(state, queue, exchange, routing_key)

@spec binding_delete(t(), String.t(), String.t(), String.t()) :: t()

Deletes a binding (queue, exchange, routing_key).

clear(broker_state)

@spec clear(t()) :: t()

Clears all exchanges, bindings, and queue indices.

delete_exchange(state, exchange)

@spec delete_exchange(t(), String.t()) :: t()

Deletes an exchange from state.exchanges.

has_binding?(broker_state, queue, exchange, routing_key)

@spec has_binding?(t(), String.t(), String.t(), String.t()) :: boolean()

Returns true if (queue, exchange, routing_key) is bound.

new(exchanges \\ %{})

@spec new(map()) :: t()

Creates a new %BrokerState{}.

put_exchange(state, exchange, meta)

@spec put_exchange(t(), String.t(), map()) :: t()

Puts or updates an exchange entry in state.exchanges.

queue_bindings(state, queue)

@spec queue_bindings(t(), String.t()) :: [queue_binding()]

Returns a list of {exchange, routing_key, arguments} tuples for queue.

queue_bindings_delete(state, queue)

@spec queue_bindings_delete(t(), String.t()) :: t()

Deletes all bindings for queue.

remove_from_table(state, exchange, meta_tuple)

@spec remove_from_table(t(), String.t(), {String.t(), String.t() | nil, String.t()}) ::
  t()

Removes meta_tuple from exchange's routing table.