ó
P'—^c           @@  su   d  Z  d d l m Z d d l m Z d d l m Z m Z d g Z d e f d „  ƒ  YZ	 d e f d	 „  ƒ  YZ
 d
 S(   sh   
    celery.concurrency.threads
    ~~~~~~~~~~~~~~~~~~~~~~~~~~

    Pool implementation using threads.

i    (   t   absolute_import(   t   UserDicti   (   t   apply_targett   BasePoolt   TaskPoolt   NullDictc           B@  s   e  Z d  „  Z RS(   c         C@  s   d  S(   N(    (   t   selft   keyt   value(    (    s<   /tmp/pip-unpacked-wheel-gV1wwp/celery/concurrency/threads.pyt   __setitem__   s    (   t   __name__t
   __module__R	   (    (    (    s<   /tmp/pip-unpacked-wheel-gV1wwp/celery/concurrency/threads.pyR      s   c           B@  s8   e  Z d  „  Z d „  Z d „  Z d d d d d „ Z RS(   c         O@  se   y d d  l  } Wn t k
 r/ t d ƒ ‚ n X| j |  _ | j |  _ t t |  ƒ j | | Ž  d  S(   Ni    s1   The threaded pool requires the threadpool module.(   t
   threadpoolt   ImportErrort   WorkRequestt
   ThreadPoolt   superR   t   __init__(   R   t   argst   kwargsR   (    (    s<   /tmp/pip-unpacked-wheel-gV1wwp/celery/concurrency/threads.pyR      s    c         C@  sL   |  j  |  j ƒ |  _ t ƒ  |  j _ |  j j |  _ |  j j j j	 |  _
 d  S(   N(   R   t   limitt   _poolR   t   workRequestst
   putRequestt
   _quick_putt   _results_queuet   queuet   cleart   _quick_clear(   R   (    (    s<   /tmp/pip-unpacked-wheel-gV1wwp/celery/concurrency/threads.pyt   on_start$   s    c         C@  s   |  j  j |  j d t ƒd  S(   Nt   do_join(   R   t   dismissWorkersR   t   True(   R   (    (    s<   /tmp/pip-unpacked-wheel-gV1wwp/celery/concurrency/threads.pyt   on_stop,   s    c         K@  s<   |  j  t | | | | | f ƒ } |  j | ƒ |  j ƒ  | S(   N(   R   R   R   R   (   R   t   targetR   R   t   callbackt   accept_callbackt   _t   req(    (    s<   /tmp/pip-unpacked-wheel-gV1wwp/celery/concurrency/threads.pyt   on_apply/   s
    
N(   R
   R   R   R   R!   t   NoneR'   (    (    (    s<   /tmp/pip-unpacked-wheel-gV1wwp/celery/concurrency/threads.pyR      s
   	
			N(   t   __doc__t
   __future__R    t   celery.fiveR   t   baseR   R   t   __all__R   R   (    (    (    s<   /tmp/pip-unpacked-wheel-gV1wwp/celery/concurrency/threads.pyt   <module>   s   	