# Dequeue

> Tag 3: the client names a key and withdraws every message waiting for the agent under it; the server answers with exactly one channel response stating whether any was, and answers each withdrawn message on its own enqueue channel.

Canonical: https://protocol.diverge.network/2.3.0/container-proxy-endpoints/agents-begin/client/dequeue/
Specification revision: 2.3.0

The client opens this channel to withdraw every message waiting for
the agent under a key — the key an [enqueue](/2.3.0/container-proxy-endpoints/agents-begin/client/enqueue/) carried:
those the server holds under it, and those the loop in flight holds
under it and has not taken. A message under another key stays where
it is, and a message the loop has taken stays taken.

- **The request.** The tag byte `3` followed by the key as JSON.
  [Request](/2.3.0/container-proxy-endpoints/agents-begin/client/dequeue/request/) states its form.
- **The response.** Exactly one channel response and the channel
  response finish. [Response](/2.3.0/container-proxy-endpoints/agents-begin/client/dequeue/response/) states the
  sequence.
- **The messages withdrawn.** Each message withdrawn is answered on
  its own [enqueue](/2.3.0/container-proxy-endpoints/agents-begin/client/enqueue/) channel with the byte `1`.
