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, **kwargs)¶
- Prepare message for sending.
- publish(message, exchange, routing_key, **kwargs)¶
- Publish a message to the queue.
- class carrot.backends.queue.Message(backend, **kwargs)¶
Message received from the backend.