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.

class Message(backend, **kwargs)

Message received from the backend.

See carrot.backends.base.BaseMessage.

Backend.consume(limit=None)

Go into consume mode.

Backend.declare_consumer(queue, no_ack, callback, consumer_tag, nowait=False)
Backend.drain_events(timeout=None)
Backend.establish_connection()
Backend.get(*args, **kwargs)

Get the next waiting message from the queue.

Returns:A Message instance, or None if there is no messages waiting.
Backend.prepare_message(message_data, delivery_mode, content_type, content_encoding, **kwargs)

Prepare message for sending.

Backend.publish(message, exchange, routing_key, **kwargs)

Publish a message to the queue.

Backend.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.

Previous topic

carrot.backends.pystomp

Next topic

carrot.serialization

This Page