Repository URL to install this package:
Version:
3.3.42 ▾
|
ó öEYc @@ s( d Z d d l m Z m Z d d l Z d d l m Z m Z d d l m Z d d l m Z m Z d d l m Z d Z d Z i e d 6e d 6Z d d d d g Z d f Z d Z d Z e e d Z e d e f d Y Z e d e f d Y Z e d e f d Y Z d S( u Exchange and Queue declarations.i ( t absolute_importt unicode_literalsNi ( t MaybeChannelBoundt Object( t ContentDisallowed( t python_2_unicode_compatiblet string_t( t prepare_accept_contenti u transientu persistentu Exchangeu Queueu bindingu maybe_delivery_modeu amq.c C@ s@ t | } t | t r5 | j d r5 | d d !S| d d !S( Nu u'i iÿÿÿÿi ( t reprt isinstanceR t startswith( t s( ( sA /home/tvault/.virtenv/lib/python2.7/site-packages/kombu/entity.pyt _reprstr s c C@ s d j d j t t | S( Nu [{0}]u , ( t formatt joint mapt str( t bindings( ( sA /home/tvault/.virtenv/lib/python2.7/site-packages/kombu/entity.pyt pretty_bindings s c C@ s( | r$ t | t j r | S| | S| S( u1 Get delivery mode by name (or none if undefined).( R t numberst Integral( t vt modest default( ( sA /home/tvault/.virtenv/lib/python2.7/site-packages/kombu/entity.pyt maybe_delivery_mode s t Exchangec B@ sa e Z d Z e Z e Z d Z d Z e Z e Z e Z d Z e Z d d d d e f d e f d e f d d f d e f f Z d d d d Z d Z d Z e d d d Z d d d e d d Z d d e d d d Z d d d Z d e e d d Z e e d Z d d d d Z d Z d Z d Z d Z e d Z RS( uþ An Exchange declaration. Arguments: name (str): See :attr:`name`. type (str): See :attr:`type`. channel (kombu.Connection, ChannelT): See :attr:`channel`. durable (bool): See :attr:`durable`. auto_delete (bool): See :attr:`auto_delete`. delivery_mode (enum): See :attr:`delivery_mode`. arguments (Dict): See :attr:`arguments`. no_declare (bool): See :attr:`no_declare` Attributes: name (str): Name of the exchange. Default is no name (the default exchange). type (str): *This description of AMQP exchange types was shamelessly stolen from the blog post `AMQP in 10 minutes: Part 4`_ by Rajith Attapattu. Reading this article is recommended if you're new to amqp.* "AMQP defines four default exchange types (routing algorithms) that covers most of the common messaging use cases. An AMQP broker can also define additional exchange types, so see your broker manual for more information about available exchange types. * `direct` (*default*) Direct match between the routing key in the message, and the routing criteria used when a queue is bound to this exchange. * `topic` Wildcard match between the routing key and the routing pattern specified in the exchange/queue binding. The routing key is treated as zero or more words delimited by `"."` and supports special wildcard characters. `"*"` matches a single word and `"#"` matches zero or more words. * `fanout` Queues are bound to this exchange with no arguments. Hence any message sent to this exchange will be forwarded to all queues bound to this exchange. * `headers` Queues are bound to this exchange with a table of arguments containing headers and values (optional). A special argument named "x-match" determines the matching algorithm, where `"all"` implies an `AND` (all pairs must match) and `"any"` implies `OR` (at least one pair must match). :attr:`arguments` is used to specify the arguments. .. _`AMQP in 10 minutes: Part 4`: http://bit.ly/amqp-exchange-types channel (ChannelT): The channel the exchange is bound to (if bound). durable (bool): Durable exchanges remain active when a server restarts. Non-durable exchanges (transient exchanges) are purged when a server restarts. Default is :const:`True`. auto_delete (bool): If set, the exchange is deleted when all queues have finished using it. Default is :const:`False`. delivery_mode (enum): The default delivery mode used for messages. The value is an integer, or alias string. * 1 or `"transient"` The message is transient. Which means it is stored in memory only, and is lost if the server dies or restarts. * 2 or "persistent" (*default*) The message is persistent. Which means the message is stored both in-memory, and on disk, and therefore preserved if the server dies or restarts. The default value is 2 (persistent). arguments (Dict): Additional arguments to specify when the exchange is declared. no_declare (bool): Never declare this exchange (:meth:`declare` does nothing). u u directu nameu typeu argumentsu durableu passiveu auto_deleteu delivery_modec C@ s t j | p | S( N( t DELIVERY_MODESt get( t m( ( sA /home/tvault/.virtenv/lib/python2.7/site-packages/kombu/entity.pyt <lambda> s u no_declarec K@ sK t t | j | | p" | j | _ | p4 | j | _ | j | d S( N( t superR t __init__t namet typet maybe_bind( t selfR R! t channelt kwargs( ( sA /home/tvault/.virtenv/lib/python2.7/site-packages/kombu/entity.pyR s c C@ s t d | j f S( Nu E|%s( t hashR ( R# ( ( sA /home/tvault/.virtenv/lib/python2.7/site-packages/kombu/entity.pyt __hash__¢ s c C@ s$ | j o# | j o# | j j t S( N( t no_declareR R t INTERNAL_EXCHANGE_PREFIX( R# ( ( sA /home/tvault/.virtenv/lib/python2.7/site-packages/kombu/entity.pyt _can_declare¥ s c C@ sw | j rs | d k r! | j n | } | p3 | j j d | j d | j d | j d | j d | j d | d | Sd S( uI Declare the exchange. Creates the exchange on the broker, unless passive is set in which case it will only assert that the exchange exists. Argument: nowait (bool): If set the server will not respond, and a response will not be waited for. Default is :const:`False`. t exchangeR! t durablet auto_deletet argumentst nowaitt passiveN( R* t NoneR0 R$ t exchange_declareR R! R, R- R. ( R# R/ R0 R$ ( ( sA /home/tvault/.virtenv/lib/python2.7/site-packages/kombu/entity.pyt declareª s c K@ sO t | t r | j } n | p' | j j d | j d | d | d | d | S( uñ Bind the exchange to another exchange. Arguments: nowait (bool): If set the server will not respond, and the call will not block waiting for a response. Default is :const:`False`. t destinationt sourcet routing_keyR/ R. ( R R R R$ t exchange_bind( R# R+ R6 R. R/ R$ R% ( ( sA /home/tvault/.virtenv/lib/python2.7/site-packages/kombu/entity.pyt bind_to¼ s c C@ sO t | t r | j } n | p' | j j d | j d | d | d | d | S( u; Delete previously created exchange binding from the server.R4 R5 R6 R/ R. ( R R R R$ t exchange_unbind( R# R5 R6 R/ R. R$ ( ( sA /home/tvault/.virtenv/lib/python2.7/site-packages/kombu/entity.pyt unbind_fromÏ s c K@ sD | d k r i n | } t | j | d <| j j | d | | S( u7 Create message instance to be sent with :meth:`publish`. Arguments: body (Any): Message body. delivery_mode (bool): Set custom delivery mode. Defaults to :attr:`delivery_mode`. priority (int): Message priority, 0 to broker configured max priority, where higher is better. content_type (str): The messages content_type. If content_type is set, no serialization occurs as it is assumed this is either a binary object, or you've done your own serialization. Leave blank if using built-in serialization as our library properly sets content_type. content_encoding (str): The character set in which this object is encoded. Use "binary" if sending in raw binary objects. Leave blank if using built-in serialization as our library properly sets content_encoding. properties (Dict): Message properties. headers (Dict): Message headers. u delivery_modet propertiesN( R1 R t delivery_modeR$ t prepare_message( R# t bodyR<