app.amqp

Sending/Receiving Messages (Kombu integration).

Module Contents

Classes

Queues(self,queues=None,default_exchange=None,create_missing=True,ha_policy=None,autoexchange=None,max_priority=None,default_routing_key=None) Queue name⇒ declaration mapping.
AMQP(self,app) App AMQP API: app.amqp.

Functions

utf8dict(d,encoding=”utf-8”)
utf8dict(d, encoding="utf-8")
class Queues(queues=None, default_exchange=None, create_missing=True, ha_policy=None, autoexchange=None, max_priority=None, default_routing_key=None)

Queue name⇒ declaration mapping.

Arguments:

queues (Iterable): Initial list/tuple or dict of queues. create_missing (bool): By default any unknown queues will be

added automatically, but if this flag is disabled the occurrence of unknown queues in wanted will raise KeyError.

ha_policy (Sequence, str): Default HA policy for queues with none set. max_priority (int): Default x-max-priority for queues with none set.

__init__(queues=None, default_exchange=None, create_missing=True, ha_policy=None, autoexchange=None, max_priority=None, default_routing_key=None)
__getitem__(name)
__setitem__(name, queue)
__missing__(name)
add(queue, **kwargs)

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.

Arguments:

queue (kombu.Queue, str): Queue to add. exchange (kombu.Exchange, str):

if queue is str, specifies exchange name.

routing_key (str): if queue is str, specifies binding key. exchange_type (str): if queue is str, specifies type of exchange. **options (Any): Additional declaration options used when

queue is a str.
add_compat(name, **options)
_add(queue)
_set_ha_policy(args)
_set_max_priority(args)
format(indent=0, indent_first=True)

Format routing table into string for log dumps.

select_add(queue, **kwargs)

Add new task queue that’ll be consumed from.

The queue will be active even when a subset has been selected using the celery worker -Q option.

select(include)

Select a subset of currently defined queues to consume from.

Arguments:
include (Sequence[str], str): Names of queues to consume from.
deselect(exclude)

Deselect queues so that they won’t be consumed from.

Arguments:
exclude (Sequence[str], str): Names of queues to avoid
consuming from.
new_missing(name)
consume_from()
class AMQP(app)

App AMQP API: app.amqp.

__init__(app)
create_task_message()
send_task_message()
Queues(queues, create_missing=None, ha_policy=None, autoexchange=None, max_priority=None)
Router(queues=None, create_missing=None)

Return the current task router.

flush_routes()
TaskConsumer(channel, queues=None, accept=None, **kw)
as_task_v2(task_id, name, args=None, kwargs=None, countdown=None, eta=None, group_id=None, expires=None, retries=0, chord=None, callbacks=None, errbacks=None, reply_to=None, time_limit=None, soft_time_limit=None, create_sent_event=False, root_id=None, parent_id=None, shadow=None, chain=None, now=None, timezone=None, origin=None, argsrepr=None, kwargsrepr=None)
as_task_v1(task_id, name, args=None, kwargs=None, countdown=None, eta=None, group_id=None, expires=None, retries=0, chord=None, callbacks=None, errbacks=None, reply_to=None, time_limit=None, soft_time_limit=None, create_sent_event=False, root_id=None, parent_id=None, shadow=None, now=None, timezone=None, **compat_kwargs)
_verify_seconds(s, what)
_create_task_sender()
default_queue()
queues()

Queue name⇒ declaration mapping.

queues(queues)
routes()
router()
producer_pool()
default_exchange()
utc()
_event_dispatcher()