ó
    Á›‘hx  ã                   ó’   • S SK r / SQr " S S\ R                  5      r " S S\ R                  5      r " S S\ R                  5      rg)	é    N)ÚnoneÚcriticalÚerrorÚwarnÚinfoÚdebugÚtracec                   ó   • \ rS rSrSrS rSrg)ÚIBatchedTimeré)   au  
Objects created by :met:`txaio.make_batched_timer` implement this
interface.

These APIs allow you to put call_later()'s into "buckets",
reducing the number of actual underlying delayed calls that the
event-loop (asyncio or Twisted) needs to deal with. Obviously, you
lose some amount of precision in when the timers fire in exchange
for less memory use, and fewer objects on the queues for the
underlying event-loop/reactor.

As a concrete example, in Autobahn we're using this to batch
together timers for the "auto ping" feature. In this case, it is
not vital when precisely the timers fire, but as the
connection-count increases the number of outstanding timers
becomes quite large.

It is intended to be used like so:

class Something(object):
    timers = txaio.make_batched_timer()

    def a_method(self):
        self.timers.call_later()  # drop-in API from txaio.call_later
c                 ó   • g)aN  
This speaks the same API as :meth:`txaio.call_later` and also
returns an object that has a ``.cancel`` method.

You cannot rely on any other methods/attributes of the
returned object. The timeout will actually fire at an
aribtrary time "close" to the delay specified, depening upon
the arguments this IBatchedTimer was created with.
N© )ÚselfÚdelayÚfuncÚargsÚkws        ÚTC:\Users\psant\Downloads\Noiseback\school\venv\Lib\site-packages\txaio/interfaces.pyÚ
call_laterÚIBatchedTimer.call_laterD   ó   � ó    r   N)Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r   Ú__static_attributes__r   r   r   r   r   )   s   † ñõ4	r   r   c                   ó<   • \ rS rSrSrS rS rS rS rS r	S r
S	rg
)ÚILoggeréP   a  
This defines the methods you can call on the object returned from
:meth:`txaio.make_logger` -- although the actual object may have
additional methods, you should *only* call the methods listed
here.

All the log methods have the same signature, they just differ in
what "log level" they represent to the handlers/emitters. The
``message`` argument is a format string using `PEP3101
<https://www.python.org/dev/peps/pep-3101/>`_-style references to
things from the ``kwargs``. Note that there are also the following
keys added to the ``kwargs``: ``log_time`` and ``log_level``.

For example::

    class MyThing(object):
        log = txaio.make_logger()

        def something_interesting(self, things=dict(one=1, two=2)):
            try:
                self.log.debug("Called with {things[one]}", things=things)
                result = self._method_call()
                self.log.info("Got '{result}'.", result=result)
            except Exception:
                fail = txaio.create_failure()
                self.log.critical(txaio.failure_format_traceback(fail))

The philsophy behind txaio's interface is fairly similar to
Twisted's logging APIs after version 15. See `Twisted's
documentation
<http://twistedmatrix.com/documents/current/core/howto/logger.html>`_
for details.
c                 ó   • g)zlog a critical-level messageNr   ©r   ÚmessageÚkwargss      r   r   ÚILogger.critical†   r   r   c                 ó   • g©zlog a error-level messageNr   r#   s      r   r   ÚILogger.error‰   r   r   c                 ó   • gr(   r   r#   s      r   r   ÚILogger.warnŒ   r   r   c                 ó   • g)zlog an info-level messageNr   r#   s      r   r   ÚILogger.info�   r   r   c                 ó   • g)zlog an debug-level messageNr   r#   s      r   r   ÚILogger.debug’   r   r   c                 ó   • g)zlog a trace-level messageNr   r#   s      r   r	   ÚILogger.trace•   r   r   r   N)r   r   r   r   r   r   r   r   r   r   r	   r   r   r   r   r    r    P   s&   † ñ òj'ò$ò$ò$ò%õ$r   r    c                   ó<   • \ rS rSrSr\R                  S 5       rSrg)ÚIFailedFutureé™   a%  
This defines the interface for a common object encapsulating a
failure from either an asyncio task/coroutine or a Twisted
Deferred.

An instance implementing this interface is given to any
``errback`` callables you provide via :meth:`txaio.add_callbacks`

In your errback you can extract information from an IFailedFuture
with :meth:`txaio.failure_message` and
:meth:`txaio.failure_traceback` or use ``.value`` to get the
Exception instance.

Depending on other details or methods will probably cause
incompatibilities between asyncio and Twisted.
c                 ó   • g)zX
An actual Exception instance. Same as the second item returned from
``sys.exc_info()``
Nr   )r   s    r   ÚvalueÚIFailedFuture.value«   r   r   r   N)	r   r   r   r   r   ÚabcÚabstractpropertyr6   r   r   r   r   r3   r3   ™   s!   † ñð" 	×Ññó ór   r3   )r8   Ú
log_levelsÚABCr   r    r3   r   r   r   Ú<module>r<      sE   ðó6 ò€
ô$�C—G‘Gô $ôNF$ˆc�g‰gô F$ôR�C—G‘Gõ r   