carrot.backends.queue — Carrot v0.5.0 documentation

### Navigation

- index
- modules |
- next |
- previous |
- Carrot v0.5.0 documentation »
- API Reference »

# carrot.backends.queue

Backend for unit-tests, using the Python `Queue` module.

class `carrot.backends.queue.` `Backend`(connection, **kwargs)

  Backend using the Python `Queue` library. Usually only used while executing unit tests.

  Please not that this backend does not support queues, exchanges or routing keys, so all messages will be sent to all consumers.

  `consume`(queue, no_ack, callback, consumer_tag)
    Go into consume mode.
  `get`(*args, **kwargs)

    Get the next waiting message from the queue.

    Returns: | A `Message` instance, or `None` if there is no messages waiting.

  `prepare_message`(message_data, delivery_mode, content_type, content_encoding, **kwargs)
    Prepare message for sending.
  `publish`(message, exchange, routing_key, **kwargs)
    Publish a message to the queue.
  `purge`(queue, **kwargs)
    Discard all messages in the queue.

class `carrot.backends.queue.` `Message`(backend, **kwargs)

  Message received from the backend.

  See `carrot.backends.base.BaseMessage`.

### Navigation

- index
- modules |
- next |
- previous |
- Carrot v0.5.0 documentation »
- API Reference »