This document describes the current stable version of Celery (3.1). For development docs, go here.
celery.app.amqp¶
Sending and receiving messages using Kombu.
AMQP¶
-
class
celery.app.amqp.
AMQP
(app)[source]¶ -
Connection
¶ Broker connection class used. Default is
kombu.Connection
.
-
Consumer
¶ Base Consumer class used. Default is
kombu.compat.Consumer
.
-
Queues
(queues, create_missing=None, ha_policy=None, autoexchange=None)[source]¶ Create new
Queues
instance, using queue defaults from the current configuration.
-
TaskConsumer
[source]¶ Return consumer configured to consume from the queues we are configured for (
app.amqp.queues.consume_from
).
-
publisher_pool
¶
-
routes
¶
-
Queues¶
-
class
celery.app.amqp.
Queues
(queues=None, default_exchange=None, create_missing=True, ha_policy=None, autoexchange=None)[source]¶ Queue name⇒ declaration mapping.
Parameters: - queues – Initial list/tuple or dict of queues.
- create_missing – By default any unknown queues will be
added automatically, but if disabled
the occurrence of unknown queues
in wanted will raise
KeyError
. - ha_policy – Default HA policy for queues with none set.
-
add
(queue, **kwargs)[source]¶ Add new queue.
The first argument can either be a
kombu.Queue
instance, or the name of a queue. If the former the rest of the keyword arguments are ignored, and options are simply taken from the queue instance.Parameters: - queue –
kombu.Queue
instance or name of the queue. - exchange – (if named) specifies exchange name.
- routing_key – (if named) specifies binding key.
- exchange_type – (if named) specifies type of exchange.
- **options – (if named) Additional declaration options.
- queue –
-
consume_from
¶
-
deselect
(exclude)[source]¶ Deselect queues so that they will not be consumed from.
Parameters: exclude – Names of queues to avoid consuming from. Can be iterable or string.
-
select
(include)[source]¶ Sets
consume_from
by selecting a subset of the currently defined queues.Parameters: include – Names of queues to consume from. Can be iterable or string.
-
select_add
(queue, **kwargs)[source]¶ Add new task queue that will be consumed from even when a subset has been selected using the
-Q
option.
-
select_remove
(exclude)¶ Deselect queues so that they will not be consumed from.
Parameters: exclude – Names of queues to avoid consuming from. Can be iterable or string.
-
select_subset
(include)¶ Sets
consume_from
by selecting a subset of the currently defined queues.Parameters: include – Names of queues to consume from. Can be iterable or string.