Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
Size: Mime:
ó
öEYc	@@s¯dZddlmZmZddlZddlZddlZddlmZddl	m
Z
ddlmZddl
mZddlmZmZmZdd	lmZd
dlmZmZd
dlmZmZd
d
lmZd
dlmZd
dl mZyddl!m"Z"WnIe#k
rgyddl$m"Z"Wqhe#k
rcddl%m"Z"qhXnXdddddddddg	Z&dZ'ee(ƒZ)da+d„Z,d„Z-e.d„Z/defd„ƒYZ0d „Z1de2d!„Z3dd"„Z4dd#„Z5d
ddd$„Z6d
ddd%„Z7dde2d&„Z8de2dd'„Z9d(„Z:d)„Z;e
d*„ƒZ<dd+„Z=dd,„Z>ddd-„Z?d.e@fd/„ƒYZAdS(0uCommon Utilities.i(tabsolute_importtunicode_literalsN(tdeque(tcontextmanager(tpartial(tcount(tuuid4tuuid3t
NAMESPACE_OID(tRecoverableConnectionErrori(tExchangetQueue(tbytes_if_py2trange(t
get_logger(tregistry(tuuid(t	get_identu	Broadcastu
maybe_declareuuuiduitermessagesu
send_replyucollect_repliesuinsuredudrain_consumeru	eventloopiÿÿcC@stdkrtƒjantS(N(t_node_idtNoneRtint(((sA/home/tvault/.virtenv/lib/python2.7/site-packages/kombu/common.pytget_node_id+scC@s5td|||t|ƒfƒ}ttt|ƒƒS(Nu%x-%x-%x-%x(RtidtstrRR(tnode_idt
process_idt	thread_idtinstancetent((sA/home/tvault/.virtenv/lib/python2.7/site-packages/kombu/common.pytgenerate_oid2scC@s+ttƒtjƒ|r!tƒnd|ƒS(Ni(RRtostgetpidR(Rtthreads((sA/home/tvault/.virtenv/lib/python2.7/site-packages/kombu/common.pytoid_from8s
	t	BroadcastcB@s3eZdZejdZddeddd„ZRS(u&Broadcast queue.

    Convenience class used to define broadcast queues.

    Every queue instance will have a unique name,
    and both the queue and exchange is configured with auto deletion.

    Arguments:
        name (str): This is used as the name of the exchange.
        queue (str): By default a unique id is used for the queue
            name for every consumer.  You can specify a custom
            queue name here.
        **kwargs (Any): See :class:`~kombu.Queue` for a list
            of additional keyword arguments supported.
    uqueuecK@sp|pdjtƒƒ}tt|ƒjd|p3|d|d|d|d|dk	rZ|nt|ddƒ|S(	Nu	bcast.{0}taliastqueuetnametauto_deletetexchangettypeufanout(tformatRtsuperR"t__init__RR
(tselfR%R$R&R'R#tkwargs((sA/home/tvault/.virtenv/lib/python2.7/site-packages/kombu/common.pyR+TsN(uqueueN((uqueueN(t__name__t
__module__t__doc__RtattrsRtTrueR+(((sA/home/tvault/.virtenv/lib/python2.7/site-packages/kombu/common.pyR"As
	cC@s||jjjkS(N(t
connectiontclienttdeclared_entities(tentitytchannel((sA/home/tvault/.virtenv/lib/python2.7/site-packages/kombu/common.pytdeclaration_cachedbscK@sÖ|j}|}|s3|s!t‚|j|ƒ}n|dkrW|sKt‚|j}nd}}|jr¡|jr¡|jjj}t	|ƒ}||kr¡t
Sn|rÀt||||||St|||||ƒS(uDeclare entity (cached).N(
tis_boundtAssertionErrortbindRR7R3tcan_cache_declarationR4R5thashtFalset_imaybe_declaret_maybe_declare(R6R7tretrytretry_policyR9torigtdeclaredtident((sA/home/tvault/.virtenv/lib/python2.7/site-packages/kombu/common.pyt
maybe_declarefs$	

cC@si|jstdƒ‚n|jd|ƒ|dk	rJ|rJ|j|ƒn|dk	re|j|_ntS(Nuchannel disconnectedR7(R3R	tdeclareRtaddR%R2(R6RDRER7RC((sA/home/tvault/.virtenv/lib/python2.7/site-packages/kombu/common.pyR@€s	cK@s.|jjjj|t||||||ƒS(N(R7R3R4tensureR@(R6RDRER7RCRB((sA/home/tvault/.virtenv/lib/python2.7/site-packages/kombu/common.pyR?‹sc
#@s”tƒ‰‡fd†}|g|p'g|_|ZxRt|jjjd|d|dtƒD])}yˆjƒVWq]tk
r…q]Xq]WWdQXdS(u&Drain messages from consumer instance.c@sˆj||fƒdS(N(tappend(tbodytmessage(tacc(sA/home/tvault/.virtenv/lib/python2.7/site-packages/kombu/common.pyt
on_message–stlimitttimeouttignore_timeoutsN(	Rt	callbackst	eventloopR7R3R4R2tpopleftt
IndexError(tconsumerRORPRRRNt_((RMsA/home/tvault/.virtenv/lib/python2.7/site-packages/kombu/common.pytdrain_consumer’s	
cK@s4t|jd|gd||d|d|d|ƒS(uIterator over messages.tqueuesR7RORPRR(RXtConsumer(tconnR7R$RORPRRR-((sA/home/tvault/.virtenv/lib/python2.7/site-packages/kombu/common.pytitermessages¤scc@sixb|rt|ƒptƒD]E}y|jd|ƒVWqtjk
r`|ra|ra‚qaqXqWdS(uèBest practice generator wrapper around ``Connection.drain_events``.

    Able to drain events forever, with a limit, and optionally ignoring
    timeout errors (a timeout of 1 is often used in environments where
    the socket can get "stuck", and is a best practice for Kombu consumers).

    ``eventloop`` is a generator.

    Examples:
        >>> from kombu.common import eventloop

        >>> def run(conn):
        ...     it = eventloop(conn, timeout=1, ignore_timeouts=True)
        ...     next(it)   # one event consumed, or timed out.
        ...
        ...     for _ in eventloop(conn, timeout=1, ignore_timeouts=True):
        ...         pass  # loop forever.

    It also takes an optional limit parameter, and timeout errors
    are propagated by default::

        for _ in eventloop(connection, limit=1, timeout=1):
            pass

    See Also:
        :func:`itermessages`, which is an event loop bound to one or more
        consumers, that yields any messages received.
    RPN(R
Rtdrain_eventstsocketRP(R[RORPRQti((sA/home/tvault/.virtenv/lib/python2.7/site-packages/kombu/common.pyRS­s"
cK@sg|j|d|d|d|ti|jdd6|jjdƒd6tj|jd6|jd6|S(	u³Send reply for request.

    Arguments:
        exchange (kombu.Exchange, str): Reply exchange
        req (~kombu.Message): Original request, a message with
            a ``reply_to`` property.
        producer (kombu.Producer): Producer instance
        retry (bool): If true must retry according to
            the ``reply_policy`` argument.
        retry_policy (Dict): Retry settings.
        **props (Any): Extra properties.
    R'RARBureply_tourouting_keyucorrelation_idu
serializerucontent_encoding(tpublishtdictt
propertiestgettserializersttype_to_nametcontent_typetcontent_encoding(R'treqtmsgtproducerRARBtprops((sA/home/tvault/.virtenv/lib/python2.7/site-packages/kombu/common.pyt
send_replyÒs	c	o@s„|jdtƒ}t}zKxDt|||||ŽD]*\}}|sS|jƒnt}|Vq4WWd|r|j|jƒnXdS(u,Generator collecting replies from ``queue``.uno_ackN(t
setdefaultR2R>R\tacktafter_reply_message_receivedR%(	R[R7R$targsR-tno_acktreceivedRKRL((sA/home/tvault/.virtenv/lib/python2.7/site-packages/kombu/common.pytcollect_repliesês

cC@stjd||dtƒdS(Nu#Connection error: %r. Retry in %ss
texc_info(tloggerterrorR2(texctinterval((sA/home/tvault/.virtenv/lib/python2.7/site-packages/kombu/common.pyt_ensure_errbackúscc@s+y	dVWn|j|jk
r&nXdS(N(tconnection_errorstchannel_errors(R[((sA/home/tvault/.virtenv/lib/python2.7/site-packages/kombu/common.pyt_ignore_errorss	cO@s3|r)t|ƒ|||ŽSWdQXnt|ƒS(uÚIgnore connection and channel errors.

    The first argument must be a connection object, or any other object
    with ``connection_error`` and ``channel_error`` attributes.

    Can be used as a function:

    .. code-block:: python

        def example(connection):
            ignore_errors(connection, consumer.channel.close)

    or as a context manager:

    .. code-block:: python

        def example(connection):
            with ignore_errors(connection):
                consumer.channel.close()


    Note:
        Connection and channel errors should be properly handled,
        and not ignored.  Using this function is only acceptable in a cleanup
        phase, like when a connection is lost or at shutdown.
    N(R|(R[tfunRpR-((sA/home/tvault/.virtenv/lib/python2.7/site-packages/kombu/common.pyt
ignore_errors	s
cC@s|r||ƒndS(N((R3R7t	on_revive((sA/home/tvault/.virtenv/lib/python2.7/site-packages/kombu/common.pytrevive_connection*sc

K@sŸ|p	t}|jdtƒ{}|jd|ƒ|j}tt|d|ƒ}	|j||d|d|	|}
|
|t|d|ƒŽ\}}|SWdQXdS(u›Function wrapper to handle connection errors.

    Ensures function performing broker commands completes
    despite intermittent connection failures.
    tblockterrbackRR3N(	RytacquireR2tensure_connectiontdefault_channelRR€t	autoretryRa(
tpoolR}RpR-R‚RtoptsR[R7trevivetinsuredtretvalRW((sA/home/tvault/.virtenv/lib/python2.7/site-packages/kombu/common.pyRŠ/s	!tQoScB@sGeZdZdZd„Zdd„Zdd„Zd„Zd„Z	RS(uÞThread safe increment/decrement of a channels prefetch_count.

    Arguments:
        callback (Callable): Function used to set new prefetch count,
            e.g. ``consumer.qos`` or ``channel.basic_qos``.  Will be called
            with a single ``prefetch_count`` keyword argument.
        initial_value (int): Initial prefetch count value..

    Example:
        >>> from kombu import Consumer, Connection
        >>> connection = Connection('amqp://')
        >>> consumer = Consumer(connection)
        >>> qos = QoS(consumer.qos, initial_prefetch_count=2)
        >>> qos.update()  # set initial

        >>> qos.value
        2

        >>> def in_some_thread():
        ...     qos.increment_eventually()

        >>> def in_some_other_thread():
        ...     qos.decrement_eventually()

        >>> while 1:
        ...    if qos.prev != qos.value:
        ...        qos.update()  # prefetch changed so update.

    It can be used with any function supporting a ``prefetch_count`` keyword
    argument::

        >>> channel = connection.channel()
        >>> QoS(channel.basic_qos, 10)


        >>> def set_qos(prefetch_count):
        ...     print('prefetch count now: %r' % (prefetch_count,))
        >>> QoS(set_qos, 10)
    cC@s+||_tjƒ|_|p!d|_dS(Ni(tcallbackt	threadingtRLockt_mutextvalue(R,Rt
initial_value((sA/home/tvault/.virtenv/lib/python2.7/site-packages/kombu/common.pyR+ns	icC@s<|j*|jr/|jt|dƒ|_nWdQX|jS(u¶Increment the value, but do not update the channels QoS.

        Note:
            The MainThread will be responsible for calling :meth:`update`
            when necessary.
        iN(RR‘tmax(R,tn((sA/home/tvault/.virtenv/lib/python2.7/site-packages/kombu/common.pytincrement_eventuallyss
	"cC@sM|j;|jr@|j|8_|jdkr@d|_q@nWdQX|jS(u¶Decrement the value, but do not update the channels QoS.

        Note:
            The MainThread will be responsible for calling :meth:`update`
            when necessary.
        iN(RR‘(R,R”((sA/home/tvault/.virtenv/lib/python2.7/site-packages/kombu/common.pytdecrement_eventuallys
	cC@sj||jkrf|}|tkr:tjdtƒd}ntjd|ƒ|jd|ƒ||_n|S(u#Set channel prefetch_count setting.u(QoS: Disabled: prefetch_count exceeds %riubasic.qos: prefetch_count->%stprefetch_count(tprevtPREFETCH_COUNT_MAXRutwarntdebugR(R,tpcountt	new_value((sA/home/tvault/.virtenv/lib/python2.7/site-packages/kombu/common.pytsets		cC@s$|j|j|jƒSWdQXdS(u)Update prefetch count with current value.N(RRžR‘(R,((sA/home/tvault/.virtenv/lib/python2.7/site-packages/kombu/common.pytupdatešs
N(
R.R/R0RR˜R+R•R–RžRŸ(((sA/home/tvault/.virtenv/lib/python2.7/site-packages/kombu/common.pyRŒCs'		
(BR0t
__future__RRRR^RŽtcollectionsRt
contextlibRt	functoolsRt	itertoolsRRRRRtamqpR	R6R
RtfiveRR
tlogRt
serializationRRdt
utils.uuidt_threadRtImportErrortthreadtdummy_threadt__all__R™R.RuRRRRR2R!R"R8R>RFR@R?RXR\RSRlRsRyR|R~R€RŠtobjectRŒ(((sA/home/tvault/.virtenv/lib/python2.7/site-packages/kombu/common.pyt<module>sb

						!	&		!