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ÅddlZddlZddlZddlZddlZddlZddlmZmZmZm	Z	m
Z
ddlmZddddgZ
ee
jfZeeefZeZe	jdƒZe	jd	ƒZejrïe	jd
ƒZnejr
e	jdƒZnejZejZdZda!e"ej#j$d
dƒƒa%da&a'da(a)e*a+gZ,d„Z-d„Z.d„Z/d„Z0de1fd„ƒYZ2d„Z3ej4d„ƒZ5d„Z6dS(iÿÿÿÿN(teventtgreeniotgreenthreadtpatcherttimeout(tsixtexecutetProxytkillalltset_num_threadstsockett	threadingtQueuetqueuet tEVENTLET_THREADPOOL_SIZEicCsŸx˜tršytjdƒ}|s't‚Wntk
r<PnXxWtjƒs–y3tjdtƒ\}}|j	|ƒd}}Wq@tk
r’q@Xq@WqWdS(Nitblock(tTruet_rsocktrecvtAssertionErrort
ValueErrort_rspqtemptytgettFalsetsendtNonetEmpty(t_ctetrv((sC/home/tvault/.virtenv/lib/python2.7/site-packages/eventlet/tpool.pyttpool_trampoline5s	


cCsÞx×trÙytjƒ}Wntk
r-dSX|dkr>dS|\}}}}d}y|||Ž}Wn0tk
r‚ntk
r›tjƒ}nXt	j
||fƒd}}}}}}tjt
ƒqWdS(N(Rt_reqqRtAttributeErrorRtSYS_EXCStEXC_CLASSEStsystexc_infoRtputt_wsocktsendallt_bytetosend(tmsgRtmethtargstkwargsR((sC/home/tvault/.virtenv/lib/python2.7/site-packages/eventlet/tpool.pyttworkerGs$	


cOsøtƒtjƒ}|tks7tjƒs7tdkrD|||ŽStjƒ}t	j
||||fƒ|jƒ}t|t
ƒrôt|ƒdkrôt|dtƒrô|\}}}tsÞtj|||ƒtjƒntj|||ƒn|S(sÊ
    Execute *meth* in a Python thread, blocking the current coroutine/
    greenthread until the method completes.

    The primary use case for this is to wrap an object or module that is not
    amenable to monkeypatching or any of the other tricks that Eventlet uses
    to achieve cooperative yielding.  With tpool, you can force such objects to
    cooperate with green threads by sticking them in native threads, at the cost
    of some overhead.
    iii(tsetupRt
currentThreadt_threadstimpt	lock_heldt	_nthreadsRtEventR!R'twaitt
isinstancettupletlenR$tQUIETt	tracebacktprint_exceptiontprint_stackRtreraise(R,R-R.t	my_threadRRtcttb((sC/home/tvault/.virtenv/lib/python2.7/site-packages/eventlet/tpool.pyR_s $

cOsZ|jdtƒr$|||Ž}nt|||Ž}t||ƒrRt||ƒS|SdS(s
    Call a function *f* and returns the value.  If the type of the return value
    is in the *autowrap* collection, then it is wrapped in a :class:`Proxy`
    object before return.

    Normally *f* will be called in the threadpool with :func:`execute`; if the
    keyword argument "nonblocking" is set to ``True``, it will simply be
    executed directly.  This is useful if you have an object which has methods
    that don't need to be called in a separate thread, but which return objects
    that should be Proxy wrapped.
    tnonblockingN(tpopRRR8R(tautowraptfR-R.R((sC/home/tvault/.virtenv/lib/python2.7/site-packages/eventlet/tpool.pyt
proxy_calls
cBs¿eZdZddd„Zd„Zd„Zd„Zdd„Zdd„Z	d„Z
d„Zd	„Zd
„Z
d„Zd„Zd
„Zd„Zd„ZeZd„Zd„ZeZRS(sý
    a simple proxy-wrapper of any object that comes with a
    methods-only interface, in order to forward every method
    invocation onto a thread in the native-thread pool.  A key
    restriction is that the object's methods should not switch
    greenlets or use Eventlet primitives, since they are in a
    different thread from the main hub, and therefore might behave
    unexpectedly.  This is for running native-threaded code
    only.

    It's common to want to have some of the attributes or return
    values also wrapped in Proxy objects (for example, database
    connection objects produce cursor objects which also should be
    wrapped in Proxy objects to remain nonblocking).  *autowrap*, if
    supplied, is a collection of types; if an attribute or return
    value matches one of those types (via isinstance), it will be
    wrapped in a Proxy.  *autowrap_names* is a collection
    of strings, which represent the names of attributes that should be
    wrapped in Proxy objects when accessed.
    cCs||_||_||_dS(N(t_objt	_autowrapt_autowrap_names(tselftobjREtautowrap_names((sC/home/tvault/.virtenv/lib/python2.7/site-packages/eventlet/tpool.pyt__init__­s		csotˆjˆƒ‰tˆdƒsVtˆˆjƒsBˆˆjkrRtˆˆjƒSˆS‡‡‡fd†}|S(Nt__call__csEtˆjˆ||Ž}ˆˆjkrAt|tƒrAt|ƒS|S(N(RGRIRJR8R(R-R.tresult(t	attr_nameRFRK(sC/home/tvault/.virtenv/lib/python2.7/site-packages/eventlet/tpool.pytdoit¹s
(tgetattrRHthasattrR8RIRJR(RKRQRR((RQRFRKsC/home/tvault/.virtenv/lib/python2.7/site-packages/eventlet/tpool.pyt__getattr__²s!cCst|j|jj|ƒS(N(RGRIRHt__getitem__(RKtkey((sC/home/tvault/.virtenv/lib/python2.7/site-packages/eventlet/tpool.pyRVÃscCst|j|jj||ƒS(N(RGRIRHt__setitem__(RKRWtvalue((sC/home/tvault/.virtenv/lib/python2.7/site-packages/eventlet/tpool.pyRXÆscCst|j|jj|ƒS(N(RGRIRHt__deepcopy__(RKtmemo((sC/home/tvault/.virtenv/lib/python2.7/site-packages/eventlet/tpool.pyRZÉscCst|j|jj|ƒS(N(RGRIRHt__copy__(RKR[((sC/home/tvault/.virtenv/lib/python2.7/site-packages/eventlet/tpool.pyR\ÌscOsKd|jkr.tt|j|j||ŽƒSt|j|j||ŽSdS(NRO(RJRRGRIRH(RKtatkw((sC/home/tvault/.virtenv/lib/python2.7/site-packages/eventlet/tpool.pyROÏscCst|j|jjƒS(N(RGRIRHt	__enter__(RK((sC/home/tvault/.virtenv/lib/python2.7/site-packages/eventlet/tpool.pyR_ÕscGst|j|jj|ŒS(N(RGRIRHt__exit__(RKtexc((sC/home/tvault/.virtenv/lib/python2.7/site-packages/eventlet/tpool.pyR`ØscCs
|j|kS(N(RH(RKtrhs((sC/home/tvault/.virtenv/lib/python2.7/site-packages/eventlet/tpool.pyt__eq__ÞscCs
|jjƒS(N(RHt__hash__(RK((sC/home/tvault/.virtenv/lib/python2.7/site-packages/eventlet/tpool.pyRdáscCs
|jjƒS(N(RHt__repr__(RK((sC/home/tvault/.virtenv/lib/python2.7/site-packages/eventlet/tpool.pyReäscCs
|jjƒS(N(RHt__str__(RK((sC/home/tvault/.virtenv/lib/python2.7/site-packages/eventlet/tpool.pyRfçscCs
t|jƒS(N(R:RH(RK((sC/home/tvault/.virtenv/lib/python2.7/site-packages/eventlet/tpool.pyt__len__êscCs
t|jƒS(N(tboolRH(RK((sC/home/tvault/.virtenv/lib/python2.7/site-packages/eventlet/tpool.pyt__nonzero__íscCs0t|jƒ}||jkr"|St|ƒSdS(N(titerRHR(RKtit((sC/home/tvault/.virtenv/lib/python2.7/site-packages/eventlet/tpool.pyt__iter__òscCst|jt|jƒS(N(RGRItnextRH(RK((sC/home/tvault/.virtenv/lib/python2.7/site-packages/eventlet/tpool.pyRmùs((N(t__name__t
__module__t__doc__RNRURVRXRRZR\ROR_R`RcRdReRfRgRit__bool__RlRmt__next__(((sC/home/tvault/.virtenv/lib/python2.7/site-packages/eventlet/tpool.pyR—s(														cCsÂtr
dStatdks(tdƒ‚tdkrSddl}|jdtƒntddƒatddƒa	t
j
t
jt
jƒ}|j
dƒ|jdƒt
j
t
jt
jƒ}|j|jƒƒ|jt
jt
jtƒ|jƒ\a}tjdƒtjt
jt
jtƒ|jƒtj|ƒatjdƒxZtjjtƒD]F}tj dt!d	d
|ƒ}|j"tƒ|j#ƒt$j%|ƒqXWt&j't(ƒa)t*j+dƒdS(Nis(Can't specify negative number of threadsiÿÿÿÿsªZero threads in tpool.  All tpool.execute calls will            execute in main thread.  Check the value of the environment             variable EVENTLET_THREADPOOL_SIZE.tmaxsizes	127.0.0.1ittargettnamestpool_thread_%s(s	127.0.0.1i(,t_setup_alreadyRR5RtwarningstwarntRuntimeWarningRR!RR
tAF_INETtSOCK_STREAMtbindtlistentconnecttgetsocknamet
setsockopttIPPROTO_TCPtTCP_NODELAYtacceptR(t
settimeoutRtcloseRtGreenSocketRRtmovestrangeRtThreadR/t	setDaemontstartR2tappendRtspawn_nR t_coroteventlettsleep(Rwtsocktcsockt_addrtitt((sC/home/tvault/.virtenv/lib/python2.7/site-packages/eventlet/tpool.pyR0ÿs<








cCs%ts
dStjdƒxtD]}tjdƒqWxtD]}|jƒq<Wt2xdtdk	rºtj	ƒrºy3tj
dtƒ\}}|j|ƒd}}WqWt
k
r¶qWXqWWtdk	r×tjtƒntdk	rötjƒdantdk	rtjƒdandatadS(NiR(RvRRR2R!R'RtjoinRRRRRRRŽRtkillRR…R((tthrRR((sC/home/tvault/.virtenv/lib/python2.7/site-packages/eventlet/tpool.pyR*s2





	
	cCs
|adS(N(R5(tnthreads((sC/home/tvault/.virtenv/lib/python2.7/site-packages/eventlet/tpool.pyR	Ns(7tatexitR3tosR%R<RRRRRRteventlet.supportRt__all__t	ExceptiontTimeoutR$t
GeneratorExittKeyboardInterruptt
SystemExitR#RR;toriginalR
RtPY2tQueue_moduletPY3RRR*RRŽtinttenvironRR5R!RRR(RRvR2R R/RRGtobjectRR0tregisterRR	(((sC/home/tvault/.virtenv/lib/python2.7/site-packages/eventlet/tpool.pyt<module>sD(				

			"	h	+$