# `Kombu.Queue`
[🔗](https://github.com/hacktobeer/kombu/blob/v0.1.0/lib/kombu/entity/queue.ex#L1)

A Queue declaration (`kombu.entity.Queue`).

# `t`

```elixir
@type t() :: %Kombu.Queue{
  alias: String.t() | nil,
  auto_delete: boolean(),
  binding_arguments: map() | nil,
  bindings: [Kombu.Binding.t()],
  channel: Kombu.Channel.t() | nil,
  consumer_arguments: map() | nil,
  durable: boolean(),
  exchange: Kombu.Exchange.t() | nil,
  exclusive: boolean(),
  expires: number() | nil,
  max_length: integer() | nil,
  max_length_bytes: integer() | nil,
  max_priority: integer() | nil,
  message_ttl: number() | nil,
  name: String.t(),
  no_ack: boolean(),
  no_declare: boolean(),
  on_declared:
    (String.t(), non_neg_integer(), non_neg_integer() -&gt; any()) | nil,
  queue_arguments: map() | nil,
  routing_key: String.t()
}
```

# `as_dict`

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

Converts the queue into a dictionary representation (`as_dict`).

# `assert_bound!`

```elixir
@spec assert_bound!(t(), Kombu.Channel.t() | nil) :: Kombu.Channel.t()
```

Raises `Kombu.NotBoundError` if neither `queue.channel` nor `channel` is bound.

# `bind`

```elixir
@spec bind(t(), Kombu.Channel.t() | nil) :: t()
```

Binds the queue (and its exchange if present) to `channel`.

# `bind_to`

```elixir
@spec bind_to(t(), Kombu.Exchange.t() | String.t() | nil, keyword()) :: term()
```

Binds the queue to `exchange` with `routing_key` (`Queue.bind_to`).

# `bound?`

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

Returns `true` if the queue is bound to a channel.

# `can_cache_declaration?`

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

Returns `true` if declaration of this queue can be cached (`not auto_delete` and not expiring).

# `can_declare?`

```elixir
@spec can_declare?(t()) :: boolean()
```

Returns `true` if the queue should be declared on the broker.

# `cancel`

```elixir
@spec cancel(t(), String.t(), keyword()) :: term()
```

Cancels a consumer by tag (`Queue.cancel`).

# `consume`

```elixir
@spec consume(t(), String.t() | keyword(), function() | nil | keyword(), keyword()) ::
  term()
```

Starts a queue consumer (`Queue.consume`).

# `declare`

```elixir
@spec declare(t(), keyword()) :: String.t()
```

Declares the exchange (if any), declares the queue, and binds the queue.
Returns `{:ok, queue_name}` or `queue_name` matching `kombu.entity.Queue.declare`.

# `delete`

```elixir
@spec delete(t(), keyword()) :: term()
```

Deletes the queue (`Queue.delete`).

# `equal?`

```elixir
@spec equal?(t(), term()) :: boolean()
```

Compares two `%Kombu.Queue{}` structs for value equality (ignoring channel binding).

# `from_dict`

```elixir
@spec from_dict(String.t(), map() | keyword()) :: t()
```

Constructs a `%Kombu.Queue{}` from a dictionary (`Queue.from_dict`).

# `get`

```elixir
@spec get(t(), keyword()) :: Kombu.Message.t() | nil
```

Polls the server for a single message in the queue (`Queue.get`).

# `maybe_bind`

```elixir
@spec maybe_bind(t(), Kombu.Channel.t() | nil) :: t()
```

Binds the queue (and its exchange) to `channel` if not already bound.

# `new`

Creates a new `%Kombu.Queue{}`.
Supports:
- `Queue.new(name, opts)`
- `Queue.new(name, exchange, opts)`
- `Queue.new(name, exchange, routing_key, opts)`

# `new`

# `new`

# `purge`

```elixir
@spec purge(t(), keyword()) :: non_neg_integer()
```

Purges all ready messages from the queue (`Queue.purge`).

# `queue_bind`

```elixir
@spec queue_bind(t(), keyword()) :: term()
```

Creates the queue binding(s) on the broker (`Queue.queue_bind`).

# `queue_declare`

```elixir
@spec queue_declare(t(), keyword()) :: String.t()
```

Declares the queue on the broker (`Queue.queue_declare`).
Returns the queue name.

# `revive`

```elixir
@spec revive(t(), term()) :: t()
```

Revives the queue with a new channel (`Queue.revive`).

# `to_rabbitmq_queue_arguments`

```elixir
@spec to_rabbitmq_queue_arguments(map() | nil, keyword()) :: map() | nil
```

Builds RabbitMQ-compatible queue arguments (`x-expires`, `x-message-ttl`,
`x-max-length`, `x-max-length-bytes`, `x-max-priority`) merged with `arguments`.

# `unbind`

```elixir
@spec unbind(t(), keyword()) :: term()
```

Unbinds the queue from its configured exchange (`Queue.unbind`).

# `unbind_from`

```elixir
@spec unbind_from(t(), Kombu.Exchange.t() | String.t() | nil, keyword()) :: term()
```

Unbinds the queue from `exchange` (`Queue.unbind_from`).

---

*Consult [api-reference.md](api-reference.md) for complete listing*
