ó
ÐH/\c           @` sž   d  Z  d d l m Z d d l m Z d d l m Z d d l Z d d l m Z d d l m Z d d	 g Z	 d e f d
 „  ƒ  YZ
 d	 e f d „  ƒ  YZ d S(   så   
Interfaces gevent uses that don't belong any one place.

This is not a public module, these interfaces are not
currently exposed to the public, they mostly exist for
documentation and testing purposes.

.. versionadded:: 1.3b2

i    (   t   absolute_import(   t   division(   t   print_functionN(   t	   Interface(   t	   Attributet   ILoopt   IWatcherc           B` s  e  Z d  Z e d ƒ Z e d ƒ Z e e d „ Z d „  Z d „  Z	 d „  Z
 e d d „ Z d e d d	 „ Z e d d
 „ Z e d d „ Z e d d „ Z e d d „ Z e d d „ Z e d d „ Z e j d k rê d e d „ Z n  d e d d „ Z d „  Z RS(   sl  
    The common interface expected for all event loops.

    .. caution::
       This is an internal, low-level interface. It may change
       between minor versions of gevent.

    .. rubric:: Watchers

    The methods that create event loop watchers are `io`, `timer`,
    `signal`, `idle`, `prepare`, `check`, `fork`, `async_`, `child`,
    `stat`. These all return various types of :class:`IWatcher`.

    All of those methods have one or two common arguments. *ref* is a
    boolean saying whether the event loop is allowed to exit even if
    this watcher is still started. *priority* is event loop specific.
    s3   Boolean indicating whether this is the default loops  Floating point number of seconds giving (approximately) the minimum resolution of a timer (and hence the minimun value the sleep can sleep for). On libuv, this is fixed by the library, but on libev it is just a guess and the actual value is system dependent.c         C` s   d S(   s!  
        Run the event loop.

        This is usually called automatically by the hub greenlet, but
        in special cases (when the hub is *not* running) you can use
        this to control how the event loop runs (for example, to integrate
        it with another event loop).
        N(    (   t   nowaitt   once(    (    s1   lib/python2.7/site-packages/gevent/_interfaces.pyt   run9   s    c           C` s   d S(   s0  
        now() -> float

        Return the loop's notion of the current time.

        This may not necessarily be related to :func:`time.time` (it
        may have a different starting point), but it must be expressed
        in fractional seconds (the same *units* used by :func:`time.time`).
        N(    (    (    (    s1   lib/python2.7/site-packages/gevent/_interfaces.pyt   nowC   s    c           C` s   d S(   sæ   
        Update the loop's notion of the current time.

        .. versionadded:: 1.3
           In the past, this available as ``update``. This is still available as
           an alias but will be removed in the future.
        N(    (    (    (    s1   lib/python2.7/site-packages/gevent/_interfaces.pyt
   update_nowN   s    c           C` s   d S(   sÔ  
        Clean up resources used by this loop.

        If you create loops
        (especially loops that are not the default) you *should* call
        this method when you are done with the loop.

        .. caution::

            As an implementation note, the libev C loop implementation has a
            finalizer (``__del__``) that destroys the object, but the libuv
            and libev CFFI implementations do not. The C implementation may change.

        N(    (    (    (    s1   lib/python2.7/site-packages/gevent/_interfaces.pyt   destroyW   s    c         C` s   d S(   s¶   
        Create and return a new IO watcher for the given *fd*.

        *events* is a bitmask specifying which events to watch
        for. 1 means read, and 2 means write.
        N(    (   t   fdt   eventst   reft   priority(    (    s1   lib/python2.7/site-packages/gevent/_interfaces.pyt   iog   s    g        c         C` s   d S(   s°   
        Create and return a timer watcher that will fire after *after* seconds.

        If *repeat* is given, the timer will continue to fire every *repeat* seconds.
        N(    (   t   aftert   repeatR   R   (    (    s1   lib/python2.7/site-packages/gevent/_interfaces.pyt   timero   s    c         C` s   d S(   s·   
        Create and return a signal watcher for the signal *signum*,
        one of the constants defined in :mod:`signal`.

        This is platform and event loop specific.
        N(    (   t   signumR   R   (    (    s1   lib/python2.7/site-packages/gevent/_interfaces.pyt   signalv   s    c         C` s   d S(   sU   
        Create and return a watcher that fires when the event loop is idle.
        N(    (   R   R   (    (    s1   lib/python2.7/site-packages/gevent/_interfaces.pyt   idle~   s    c         C` s   d S(   s¡   
        Create and return a watcher that fires before the event loop
        polls for IO.

        .. caution:: This method is not supported by libuv.
        N(    (   R   R   (    (    s1   lib/python2.7/site-packages/gevent/_interfaces.pyt   prepareƒ   s    c         C` s   d S(   sc   
        Create and return a watcher that fires after the event loop
        polls for IO.
        N(    (   R   R   (    (    s1   lib/python2.7/site-packages/gevent/_interfaces.pyt   check‹   s    c         C` s   d S(   sb   
        Create a watcher that fires when the process forks.

        Availability: POSIX
        N(    (   R   R   (    (    s1   lib/python2.7/site-packages/gevent/_interfaces.pyt   fork‘   s    c         C` s   d S(   s‰  
        Create a watcher that fires when triggered, possibly
        from another thread.

        .. versionchanged:: 1.3
           This was previously just named ``async``; for compatibility
           with Python 3.7 where ``async`` is a keyword it was renamed.
           On older versions of Python the old name is still around, but
           it will be removed in the future.
        N(    (   R   R   (    (    s1   lib/python2.7/site-packages/gevent/_interfaces.pyt   async_˜   s    t   win32i    c         C` s   d S(   s©   
            Create a watcher that fires for events on the child with process ID *pid*.

            This is platform specific and not available on Windows.
            N(    (   t   pidt   traceR   (    (    s1   lib/python2.7/site-packages/gevent/_interfaces.pyt   child¦   s    c         C` s   d S(   sÜ   
        Create a watcher that monitors the filesystem item at *path*.

        If the operating system doesn't support event notifications
        from the filesystem, poll for changes every *interval* seconds.
        N(    (   t   patht   intervalR   R   (    (    s1   lib/python2.7/site-packages/gevent/_interfaces.pyt   stat­   s    c         G` s   d S(   s­   
        Run the *func* passing it *args* at the next opportune moment.

        This is a way of handing control to the event loop and deferring
        an action.
        N(    (   t   funct   args(    (    s1   lib/python2.7/site-packages/gevent/_interfaces.pyt   run_callbackµ   s    N(   t   __name__t
   __module__t   __doc__R   t   defaultt   approx_timer_resolutiont   FalseR	   R
   R   R   t   Truet   NoneR   R   R   R   R   R   R   R   t   syst   platformR   R"   R%   (    (    (    s1   lib/python2.7/site-packages/gevent/_interfaces.pyR      s(   	
				c           B` s)   e  Z d  Z d „  Z d „  Z d „  Z RS(   s	  
    An event loop watcher.

    These objects call their *callback* function when the event
    loop detects the event has happened.

    .. important:: You *must* call :meth:`close` when you are
       done with this object to avoid leaking native resources.
    c         O` s   d S(   s1  
        Have the event loop begin watching for this event.

        When the event is detected, *callback* will be called with
        *args*.

        .. caution::

            Not all watchers accept ``**kwargs``,
            and some watchers define special meanings for certain keyword args.
        N(    (   t   callbackR$   t   kwargs(    (    s1   lib/python2.7/site-packages/gevent/_interfaces.pyt   startÈ   s    c           C` s   d S(   s’   
        Have the event loop stop watching this event.

        In the future you may call :meth:`start` to begin watching
        again.
        N(    (    (    (    s1   lib/python2.7/site-packages/gevent/_interfaces.pyt   stopÕ   s    c           C` s   d S(   s  
        Dispose of any native resources associated with the watcher.

        If we were active, stop.

        Attempting to operate on this object after calling close is
        undefined. You should dispose of any references you have to it
        after calling this method.
        N(    (    (    (    s1   lib/python2.7/site-packages/gevent/_interfaces.pyt   closeÝ   s    (   R&   R'   R(   R2   R3   R4   (    (    (    s1   lib/python2.7/site-packages/gevent/_interfaces.pyR   ½   s   			(   R(   t
   __future__R    R   R   R.   t   gevent._utilR   R   t   __all__R   R   (    (    (    s1   lib/python2.7/site-packages/gevent/_interfaces.pyt   <module>   s   	 