GET /queues
GET a list of queues, with some information about them queues returned are ordered firstly by creation time, secondly by UUID
-
200
A list of queues
{
"queues": [
{
"id": "queue UUID",
"name": "queue name",
"ephemeral": "is this queue ephemeral?",
"size": "int size of this queue"
},
"..."
],
"count": {
"queues": "int length of the queues list"
}
}
POST /queues
Create a queue
name | type | description | default |
---|---|---|---|
name | string | Name of this queue. Can be used instead interchangeably with its id in API calls, and so it should be unique | random |
ephemeral | bool | Is this queue ephemeral? Ephemeral queues are not backed by any storage, but instead are completely in memory. This allowes them to be written to read read from quickly, but they are lost when the server goes down | false |
capacity | int or null | The capacity of this queue If messages are pushed onto a full queue, whatever is on the head is pushed out in a fifo style. If the capacity is null, the queue has an unlimited size | null |
{
"name": "queue name",
"ephemeral": "is this queue ephemeral?"
}
-
200
The queue was created
GET /queues/:queue
Get information about this queue
-
200
Information about this queue
{
"queue": {
"id": "queue UUID",
"name": "queue name",
"ephemeral": "is this queue ephemeral?",
"size": "int size of this queue"
}
}
-
400
Nothing was found here
{
"error": "not_found"
}
PUT /queues/:queue
Put a message onto the tail of this queue If this queue does not exist, it will be created populated with the sent message
-
201
The message was put onto the queue's tail
DELETE /queues/:queue
Delete this queue Multiple calls are idempotent, so if there is no queue targeted nothing will happen
-
204
Queue was deleted
GET /queues/:queue/consume/:index
Consume a message from this queue Consuming a message will return its content, and delete it from the queue. Indexing is 0 based, starting from the head, where the most recent message will be
-
200
Whatever is on the queue at this index
-
400
Nothing is on the queue here
GET /queues/:queue/head
Pop the next message on this queue
This will consume the item at the queue's head
This is equivalent to GET /queues/:queue/consume/0
-
200
Whatever is on this queue's head
-
400
Nothing is on the queue here
GET /queues/:queue/peek/:index
Read a message from this queue without consuming it
This functions similarly to /consume
,
but does not consume messages when they are read.
Thus allowing you to "peek" at messages
-
200
Whatever is on the queue at this index
-
400
Nothing is on the queue here