Repository URL to install this package:
| 
      
        
        
        Version: 
        
         
          
          4.0.99  ▾
        
         | 
ó
 EYc           @   sr  d  d l  m Z d  d l Z d  d l m Z d  d l m Z d  d l m Z d  d l m Z d  d l m	 Z	 d  d l
 m Z m
 Z
 d  d l Z d	 d
 d d d
 d d d g Z e j Z d d  Z d   Z d   Z d   Z d   Z d   Z d   Z e Z d   Z d   d d e j f d d e j f f D \ Z Z d   Z d e j f d      YZ d!   Z d"   Z  d S(#   iÿÿÿÿ(   t   dequeN(   t   event(   t   hubs(   t   support(   t   timeout(   t   timer(   t	   greenletst   sixt
   getcurrentt   sleept   spawnt   spawn_nt   killt   spawn_aftert   spawn_after_localt   GreenThreadi    c         C   se   t  j   } t   } | j | k	 s0 t d   | j |  | j  } z | j   Wd | j   Xd S(   s	  Yield control to another eligible coroutine until at least *seconds* have
    elapsed.
    *seconds* may be specified as an integer, or a float if fractional seconds
    are desired. Calling :func:`~greenthread.sleep` with *seconds* of 0 is the
    canonical way of expressing a cooperative yield. For example, if one is
    looping over a large list performing an expensive calculation without
    calling any socket methods, it's a good idea to call ``sleep(0)``
    occasionally; otherwise nothing else will run.
    s0   do not call blocking functions from the mainloopN(   R   t   get_hubR   t   greenlett   AssertionErrort   schedule_call_globalt   switcht   cancel(   t   secondst   hubt   currentR   (    (    sI   /home/tvault/.virtenv/lib/python2.7/site-packages/eventlet/greenthread.pyR	      s    	c         O   s;   t  j   } t | j  } | j d | j |  | |  | S(   s  Create a greenthread to run ``func(*args, **kwargs)``.  Returns a
    :class:`GreenThread` object which you can use to get the results of the
    call.
    Execution control returns immediately to the caller; the created greenthread
    is merely scheduled to be run at the next available opportunity.
    Use :func:`spawn_after` to  arrange for greenthreads to be spawned
    after a finite delay.
    i    (   R   R   R   R   R   R   (   t   funct   argst   kwargsR   t   g(    (    sI   /home/tvault/.virtenv/lib/python2.7/site-packages/eventlet/greenthread.pyR
   (   s    
c         O   s   t  d |  | |  d S(   s°  Same as :func:`spawn`, but returns a ``greenlet`` object from
    which it is not possible to retrieve either a return value or
    whether it raised any exceptions.  This is faster than
    :func:`spawn`; it is fastest if there are no keyword arguments.
    If an exception is raised in the function, spawn_n prints a stack
    trace; the print can be disabled by calling
    :func:`eventlet.debug.hub_exceptions` with False.
    i    i   (   t   _spawn_n(   R   R   R   (    (    sI   /home/tvault/.virtenv/lib/python2.7/site-packages/eventlet/greenthread.pyR   8   s    
c         O   s;   t  j   } t | j  } | j |  | j | | |  | S(   sh  Spawns *func* after *seconds* have elapsed.  It runs as scheduled even if
    the current greenthread has completed.
    *seconds* may be specified as an integer, or a float if fractional seconds
    are desired. The *func* will be called with the given *args* and
    keyword arguments *kwargs*, and will be executed within its own greenthread.
    The return value of :func:`spawn_after` is a :class:`GreenThread` object,
    which can be used to retrieve the results of the call.
    To cancel the spawn and prevent *func* from being called,
    call :meth:`GreenThread.cancel` on the return value of :func:`spawn_after`.
    This will not abort the function if it's already started running, which is
    generally the desired behavior.  If terminating *func* regardless of whether
    it's started or not is the desired behavior, call :meth:`GreenThread.kill`.
    (   R   R   R   R   R   R   (   R   R   R   R   R   R   (    (    sI   /home/tvault/.virtenv/lib/python2.7/site-packages/eventlet/greenthread.pyR
   E   s    c         O   s;   t  j   } t | j  } | j |  | j | | |  | S(   s+  Spawns *func* after *seconds* have elapsed.  The function will NOT be
    called if the current greenthread has exited.
    *seconds* may be specified as an integer, or a float if fractional seconds
    are desired. The *func* will be called with the given *args* and
    keyword arguments *kwargs*, and will be executed within its own greenthread.
    The return value of :func:`spawn_after` is a :class:`GreenThread` object,
    which can be used to retrieve the results of the call.
    To cancel the spawn and prevent *func* from being called,
    call :meth:`GreenThread.cancel` on the return value. This will not abort the
    function if it's already started running.  If terminating *func* regardless
    of whether it's started or not is the desired behavior, call
    :meth:`GreenThread.kill`.
    (   R   R   R   R   t   schedule_call_localR   (   R   R   R   R   R   R   (    (    sI   /home/tvault/.virtenv/lib/python2.7/site-packages/eventlet/greenthread.pyR   \   s    c         O   s-   t  j d t d d t |  | | |  d S(   Nsª   call_after_global is renamed to spawn_after, whichhas the same signature and semantics (plus a bit extra).  Please do a quick search-and-replace on your codebase, thanks!t
   stackleveli   i    (   t   warningst   warnt   DeprecationWarningR   (   R   R   R   R   (    (    sI   /home/tvault/.virtenv/lib/python2.7/site-packages/eventlet/greenthread.pyt   call_after_globals   s    
c         O   sY   t  j d t d d t j   } t j | d | j } | j |  | j | |  } | S(   Nso   call_after_local is renamed to spawn_after_local, whichhas the same signature and semantics (plus a bit extra).R   i   t   parent(   R    R!   R"   R   R   R   R   R   (   R   t   functionR   R   R   R   t   t(    (    sI   /home/tvault/.virtenv/lib/python2.7/site-packages/eventlet/greenthread.pyt   call_after_local|   s    
c         G   sZ   t  j d t d d |  d  k r5 t j |  d    St j   } | j |  t	   j
 |  S(   NsJ   Instead of exc_after, which is deprecated, use Timeout(seconds, exception)R   i   c           S   s   d  S(   N(   t   None(    (    (    sI   /home/tvault/.virtenv/lib/python2.7/site-packages/eventlet/greenthread.pyt   <lambda>   s    (   R    R!   R"   R(   R   t   TimerR   R   R   R   t   throw(   R   t
   throw_argsR   (    (    sI   /home/tvault/.virtenv/lib/python2.7/site-packages/eventlet/greenthread.pyt	   exc_after   s    	
c         c   s0   |  ]&