Syseleven-carrot

Latest version: v0.10.999

Safety actively analyzes 682471 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 1 of 5

0.10.7

----------------------------------

* ``ConsumerSet``: Now possible to add/cancel consumers at runtime

* To add another consumer to an active set do::

>>> cset.add_consumer(C)
>>> or
>>> cset.add_consumer_from_dict(**declaration)

>>> ...
>>> consume() will declare new consumers
>>> cset.consume()

* To cancel an active consumer by queue name do::

>>> cset.cancel_by_queue(queue_name)

0.10.6

----------------------------------

* ``Publisher.send``: Now supports an exchange argument used to override the
exchange to send the message to (defaults to ``Publisher.exchange``).

Note that this exchange must have been declared.

* STOMP backend: Now supports username and password authentication.

* pika backend called basic_get with incorrect arguments.

0.10.5

----------------------------------

* In-memory backend: discard_all() now works correctly.

* Added msgpack serialization support

See http://msgpack.sourceforge.net for more information.

To enable set::

serializer="msgpack"

* Added dependency specification for building RPMs.

$ python setup.py bdist_rpm

0.10.4

----------------------------------

* Added ``BrokerConnection.drain_events()`` (only works for amqplib/pika)

`drain_events` waits for events on all active channels.

* amqplib: Added timeout support to ``drain_events``.

Example usage:

>>> c = Consumer()
>>> it = c.iterconsume()
>>> wait for event on any channel
>>> try:
... connection.drain_events(timeout=1)
... except socket.timeout:
pass

* Added Consumer.consume / ConsumerSet.consume

We're slowly moving away from ``iterconsume`` as this flow doesn't
make sense. You often want to consume from several channels at once,
so ``iterconsume`` will probably be deprecated at some point.

"new-style" consume example::

>>> connection = BrokerConnection(..)
>>> consumer = Consumer(connection, ...)
>>> consumer.register_callback(handle_message)
>>> consumer.consume() declares consumers
>>> while True:
... connection.drain_events()
>>> consumer.cancel() Cancel consumer.

More elaborate example consuming from two channels,
where the first channel consumes from multiple queues::

>>> connection = BrokerConnection(..)

The first channel receives jobs from several
queues.
>>> queues = {"video": {"exchange": "jobs",
... "queue": "video",
... "routing_key": "video"},
... "image": {"exchange": "jobs",
... "queue": "image",
... "routing_key": "image"}}
>>> job_consumer = ConsumerSet(connection, from_dict=queues)
>>> job_consumer.register_callback(handle_job)
>>> job_consumer.consume()

The second channel receives remote control commands.
>>> remote_consumer = Consumer(connection, queue="control",
... exchange="control")
>>> remote_consumer.register_callback(handle_remote_command)
>>> remote_consumer.consume()

The eventloop.
Receives a single message a pass and calls the appropriate
callback.
>>> try:
... while True:
... connection.drain_events()
... finally:
... job_consumer.close()
... remote_consumer.close()
... connection.close()

* amqplib: now raises ``KeyError`` if hostname isn't set.

0.10.3

----------------------------------

* Consumer/Publisher: A kwarg option set to ``None`` should always
mean "use the class default value". This was not always the case,
but has been fixed in this release.

* DjangoBrokerConnection: Now accepts a custom ``settings`` object. E.g.:

>>> conn = DjangoBrokerConnection(settings=mysettings)

* Consumer.iterconsume: Now raises :exc:`StopIteration` if the channel is
closed. (http://github.com/ask/carrot/issues/issue/24)

* Fixed syntax error in the DjangoBrokerConnection which could be triggered
if some conditions were met.

* setup.cfg: Disable --enable-coverage from nosetests section

* Consumer.iterconsume now works properly when using the Python Queue
module based backend (http://github.com/ask/carrot/issues/issue/23).

0.10.2

----------------------------------
* Resolved a typo in the experimental Pika backend.

Page 1 of 5

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.