3 \@sddddgZddlZddlZddlZddlZddlZddlmZddlm Z dd l m Z m Z dd lm Z dd lmZdd lmZdd lmZddZe jejedddDZedek rddZxeD]Ze jeeqWGdddeZfifddZddZGdddeZddZd d!ZGd"d#d#eZGd$d%d%eZ e j!e j"fe j#e j$fd&Z%Gd'ddeZ&Gd(d)d)e'Z(Gd*ddeZ)d+d,Z*ifd-d.Z+dd0d1Z,Gd2d3d3eZ-Gd4d5d5eZ.dd6d7Z/Gd8d9d9e)Z0Gd:d;d;e)Z1Gdd?d?e)Z3Gd@dAdAe)Z4GdBdCdCe)Z5GdDdEdEe)Z6e+dFdZ7GdZd[d[e7Z8e+d\dZ9d]deie9_:e+dfdZ;e+dgdZe>jdwej?e>jdxej?e>jdyej@e3e>jdzejAe1e>jd{ejBe1e>jd|ejCe1e>jd}ejDe1e>jd~ejEe2e>jdejFe4e>jde jGe=e>jdee8e>jdeHe9e>jd5e.e6e>jd7e/e;e>jd3e-e5e>jdee0dde>jdsdddS) BaseManager SyncManager BaseProxyTokenN) format_exc) connection) reductionget_spawning_popen)pool)process)util) get_contextcCstj|j|jffS)N)arraytypecodetobytes)ar /usr/lib64/python3.6/managers.py reduce_array$srcCsg|]}tti|qSr)typegetattr).0namerrr (sritemskeysvaluescCstt|ffS)N)list)objrrrrebuild_as_list*sr c@s4eZdZdZdZddZddZd d Zd d Zd S)rz4 Type to uniquely indentify a shared object typeidaddressidcCs||||_|_|_dS)N)r!r"r#)selfr!r"r#rrr__init__9szToken.__init__cCs|j|j|jfS)N)r!r"r#)r$rrr __getstate__<szToken.__getstate__cCs|\|_|_|_dS)N)r!r"r#)r$staterrr __setstate__?szToken.__setstate__cCsd|jj|j|j|jfS)Nz %s(typeid=%r, address=%r, id=%r)) __class____name__r!r"r#)r$rrr__repr__BszToken.__repr__N)r!r"r#) r* __module__ __qualname____doc__ __slots__r%r&r(r+rrrrr3s cCs8|j||||f|j\}}|dkr*|St||dS)zL Send a message to manager using connection `c` and return response z#RETURNN)sendrecvconvert_to_error)cr# methodnameargskwdskindresultrrrdispatchJs  r9cCs<|dkr |S|dkrt|S|dkr0td|StdSdS)Nz#ERRORz #TRACEBACKz#UNSERIALIZABLEzUnserializable message: %s zUnrecognized message type) RemoteError ValueError)r7r8rrrr2Ts r2c@seZdZddZdS)r:cCs&ddddt|jdddS)N -Kr)strr5)r$rrr__str__aszRemoteError.__str__N)r*r,r-r@rrrrr:`sr:cCs6g}x,t|D] }t||}t|r|j|qW|S)z4 Return a list of names of methods of `obj` )dirrcallableappend)rtemprfuncrrr all_methodshs  rFcCsddt|DS)zP Return a list of names of methods of `obj` which do not start with '_' cSsg|]}|ddkr|qS)r_r)rrrrrrwsz"public_methods..)rF)rrrrpublic_methodsssrHc @seZdZdZdddddddd d g Zd d Zd dZddZddZddZ ddZ ddZ ddZ e e e dZ ddZddZd d!Zd"d#Zd$d%Zd&d'Zd(d)Zd*d+Zd,d-Zd.S)/ServerzM Server class which runs in a process controlled by a manager object shutdowncreateaccept_connection get_methods debug_infonumber_of_objectsdummyincrefdecrefcCs^||_tj||_t|\}}||dd|_|jj|_ddffi|_i|_i|_ t j |_ dS)N)r"Zbacklog0) registryr AuthenticationStringauthkeylistener_clientlistenerr" id_to_objid_to_refcountid_to_local_proxy_obj threadingLockmutex)r$rUr"rW serializerListenerClientrrrr%s   zServer.__init__cCstj|_|tj_zZtj|jd}d|_|j y x|jj sN|jj dq6WWnt t fk rjYnXWdtjtjkrtjdtjt_tjt_tjdXdS)z( Run the server forever )targetTrNzresetting stdout, stderrr)r]Event stop_eventr current_process_manager_serverThreadaccepterdaemonstartis_setwaitKeyboardInterrupt SystemExitsysstdout __stdout__r debug __stderr__stderrexit)r$rirrr serve_forevers       zServer.serve_foreverc CsPxJy|jj}Wntk r&wYnXtj|j|fd}d|_|jqWdS)N)rcr5T)rYZacceptOSErrorr]rhhandle_requestrjrk)r$r3trrrriszServer.accepterc 'Cs4d}}}y>tj||jtj||j|j}|\}}}}t||}Wntk rhdtf} Yn>Xy||f||}Wntk rdtf} Yn Xd|f} y|j| Wnrtk r&} zTy|jdtfWntk rYnXt j d| t j d|t j d| WYdd} ~ XnX|j dS)z) Handle a new connection Nz #TRACEBACKz#RETURNzFailure to send message: %rz ... request was %rz ... exception was %r) rZdeliver_challengerWZanswer_challenger1r Exceptionrr0r infoclose) r$r3funcnamer8requestignorer5r6rEmsgerrrrys2    zServer.handle_requestcDCstjdtjj|j}|j}|j}x|jj syBd}}|}|\}}} } y||\}} } Wn^t k r} zBy|j |\}} } Wn&t k r}z | WYdd}~XnXWYdd} ~ XnX|| krt d|t || ft||}y|| | }Wn,tk r&}zd|f}WYdd}~XnPX| o8| j|d}|rn|j|||\}}t||j|}d||ff}nd|f}Wnt k r|dkrdtf}nNy,|j|}|||||f| | }d|f}Wn tk rdtf}YnXYnPtk r"tjdtjjtjd Yn tk r@dtf}YnXyDy ||Wn2tk r}z|d tfWYdd}~XnXWq(tk r}zBtjd tjjtjd |tjd ||jtjdWYdd}~Xq(Xq(WdS)zQ Handle requests from the proxies in a particular process/thread z$starting server thread to service %rNz+method %r of %r object is not in exposed=%rz#ERRORz#PROXYz#RETURNz #TRACEBACKz$got EOF -- exiting thread serving %rrz#UNSERIALIZABLEzexception in thread serving %rz ... message was %rz ... exception was %rr)r rsr]current_threadrr1r0rZrerlKeyErrorr\AttributeErrorrrr{getrKrr"rfallback_mappingEOFErrorrprvr|r})r$connr1r0rZr4rridentr5r6exposed gettypeidkeZ second_keZfunctionresrrr!ZridentZrexposedtokenZ fallback_funcr8rrr serve_clientsx  (        $   zServer.serve_clientcCs|S)Nr)r$rrrrrrfallback_getvalue&szServer.fallback_getvaluecCst|S)N)r?)r$rrrrrr fallback_str)szServer.fallback_strcCst|S)N)repr)r$rrrrrr fallback_repr,szServer.fallback_repr)r@r+z #GETVALUEcCsdS)Nr)r$r3rrrrP5sz Server.dummycCs||jlg}t|jj}|jxD|D]<}|dkr(|jd||j|t|j|dddfq(Wdj|SQRXdS)zO Return some info --- useful to spot problems with refcounting rTz %s: refcount=%s %srNr>r<) r_rr[rsortrCr?rZjoin)r$r3r8rrrrrrN8s  $zServer.debug_infocCs t|jS)z* Number of shared objects )lenr[)r$r3rrrrOGszServer.number_of_objectscCsLz:ytjd|jdWnddl}|jYnXWd|jjXdS)z' Shutdown this process z!manager received shutdown message#RETURNNr)rN)r rsr0 traceback print_excreset)r$r3rrrrrJNs zServer.shutdownc Os|j|j|\}}}}|dkr,|d} n |||} |dkrFt| }|dk r^t|t|}dt| } tjd|| | t||f|j| <| |j krd|j | <WdQRX|j || | t |fS)z> Create a new shared object and return its id Nrz%xz&%r callable returned object with id %r) r_rUrHrr#r rsrrZr[rQtuple) r$r3r!r5r6rBrmethod_to_typeid proxytyperrrrrrK[s      z Server.createcCst|j|jdS)zL Return the methods of the shared object indicated by token r)rrZr#)r$r3rrrrrMzszServer.get_methodscCs"|tj_|jd|j|dS)z= Spawn a new thread to serve this connection #RETURNN)rN)r]rrr0r)r$r3rrrrrLs  zServer.accept_connectioncCs|jy|j|d7<Wnhtk r}zL||jkrrd|j|<|j||j|<|j|\}}}tjd|n|WYdd}~XnXWdQRXdS)Nrz&Server re-enabled tracking & INCREF %r)r_r[rr\rZr rs)r$r3rrrrrrrrrQs  z Server.increfcCs||jkr$||jkr$tjd|dS|j.|j|d8<|j|dkrT|j|=WdQRX||jkrdfdf|j|<tjd||j|j|=WdQRXdS)NzServer DECREF skipping %rrrzdisposing of obj with id %r)r[r\r rsr_rZ)r$r3rrrrrRs     z Server.decrefN)r*r,r-r.Zpublicr%rwriryrrrrrrPrNrOrJrKrMrLrQrRrrrrrI}s. "Q rIc@seZdZdgZdZdZdZdS)StatevaluerrN)r*r,r-r/INITIALSTARTEDSHUTDOWNrrrrrsr)pickleZ xmlrpclibc@seZdZdZiZeZd!ddZddZdd Z dffd d Z e dffd d Z ddZ d"ddZddZddZddZddZeddZeddZe d#dd ZdS)$rz! Base class for managers NrcCs\|dkrtjj}||_tj||_t|_tj|j_ ||_ t |\|_ |_ |pTt|_dS)N)r rfrW_addressrV_authkeyr_staterr _serializerrXZ _Listener_Clientr_ctx)r$r"rWr`Zctxrrrr%s   zBaseManager.__init__cCst|j|j|j|jS)zX Return server object with serve_forever() method and address attribute )rI _registryrrr)r$rrr get_servers zBaseManager.get_servercCs8t|j\}}||j|jd}t|ddtj|j_dS)z> Connect manager object to the server process )rWNrP) rXrrrr9rrrr)r$rarbrrrrconnects zBaseManager.connectc Cs|dk rt| rtdtjdd\}}|jjt|j|j|j |j |j |||fd|_ dj dd|j jD}t|jd ||j _|j j|j|j|_ |jtj|j_tj|t|j|j |j |j |j|jfd d |_dS) z@ Spawn a server process for this manager object Nzinitializer must be a callableF)Zduplex)rcr5:css|]}t|VqdS)N)r?)rirrr sz$BaseManager.start..r=r)r5 exitpriority)rB TypeErrorrZPiperZProcessr _run_serverrrrr_processrZ _identityr*rrkr}r1rrrrr Finalize_finalize_managerrrJ)r$ initializerinitargsreaderwriterrrrrrks&       zBaseManager.startc CsN|dk r|||j||||}|j|j|jtjd|j|jdS)z@ Create a server, report its address and run it Nzmanager serving at %r)_Serverr0r"r}r r|rw) clsrUr"rWr`rrrserverrrrrs zBaseManager._run_serverc OsN|j|j|jd}zt|dd|f||\}}Wd|jXt||j||fS)zP Create a new shared object; return the token and exposed tuple )rWNrK)rrrr9r}r)r$r!r5r6rr#rrrr_create%s  zBaseManager._createcCs*|jdk r&|jj||jjs&d|_dS)zC Join the manager process (if it has been spawned) N)rris_alive)r$timeoutrrrr1s   zBaseManager.joinc Cs.|j|j|jd}z t|ddS|jXdS)zS Return some info about the servers shared objects and connections )rWNrN)rrrr9r})r$rrrr _debug_info:s zBaseManager._debug_infoc Cs.|j|j|jd}z t|ddS|jXdS)z5 Return the number of shared objects )rWNrO)rrrr9r})r$rrrr_number_of_objectsDs zBaseManager._number_of_objectscCs|jjtjkr|j|S)N)rrrrrk)r$rrr __enter__NszBaseManager.__enter__cCs |jdS)N)rJ)r$exc_typeexc_valexc_tbrrr__exit__TszBaseManager.__exit__cCs|jrtjdy,|||d}zt|ddWd|jXWntk rRYnX|jdd|jrtjdt|drtjd |j|jd d|jrtjd t j |_ y t j |=Wntk rYnXdS) zQ Shutdown the manager process; will be registered as a finalizer z#sending shutdown message to manager)rWNrJg?)rzmanager still alive terminatez'trying to `terminate()` manager processg?z#manager still alive after terminate)rr r|r9r}r{rhasattrrrrrr_address_to_localr)r r"rWr'rrrrrrWs.         zBaseManager._finalize_managercCs|jS)N)r)r$rrrwszBaseManager.Tc sd|jkr|jj|_dkr"t|p0tdd}|p@tdd}|r`xt|jD]\}}qTW|||f|j<|rfdd} | _t|| dS)z9 Register a typeid with the manager type rN _exposed__method_to_typeid_cs`tjd|jf||\}}||j||j|d}|j|j|jd}t|dd|jf|S)Nz)requesting creation of a shared %r object)managerrWr)rWrR) r rsrrrrr"r9r#)r$r5r6rZexpproxyr)rr!rrrDs  z"BaseManager.register..temp) __dict__rcopy AutoProxyrrrr*setattr) rr!rBrrr create_methodkeyrrDr)rr!rregisterys    zBaseManager.register)NNrN)N)NNNNT)r*r,r-r.rrIrr%rrrk classmethodrrrrrrr staticmethodrpropertyr"rrrrrrs*  $    c@seZdZddZddZdS)ProcessLocalSetcCstj|dddS)NcSs|jS)N)clear)rrrrrsz*ProcessLocalSet.__init__..)r register_after_fork)r$rrrr%szProcessLocalSet.__init__cCs t|ffS)N)r)r$rrr __reduce__szProcessLocalSet.__reduce__N)r*r,r-r%rrrrrrsrc@seZdZdZiZejZdddZddZ fifd d Z d d Z d dZ e ddZddZddZddZddZddZdS)rz. A base for proxies of shared objects NTFc Cstj8tjj|jd}|dkr:tjtf}|tj|j<WdQRX|d|_|d|_ ||_ |j j |_ ||_ ||_t|d|_||_|dk rtj||_n"|j dk r|j j|_n tjj|_|r|jtj|tjdS)Nrr)r_mutexrrr"r ZForkAwareLocalr_tls_idset_tokenr#_id_managerrrXr_owned_by_managerr rVrrfrW_increfr _after_fork) r$rr`rrWrrQ manager_ownedZ tls_idsetrrrr%s*      zBaseProxy.__init__cCsdtjdtjj}tjjdkr4|dtjj7}|j|jj |j d}t |dd|f||j _ dS)Nzmaking connection to managerZ MainThread|)rWrL)r rsr rfrr]rrrr"rr9rr)r$rrrrr_connects  zBaseProxy._connectc Csy |jj}Wn6tk rBtjdtjj|j|jj}YnX|j |j |||f|j \}}|dkrp|S|dkr|\}}|j j |jd } |jj|_| ||j|j |j|d} |j|j|jd}t|dd|jf| St||dS) zW Try to call a method of the referrent and return a copy of the result z#thread %r does not own a connectionz#RETURNz#PROXYr)rrWr)rWNrR)rrrr rsr]rrrr0rr1rrr!rr"rrrr9r#r2) r$r4r5r6rr7r8rrrrrrr _callmethods,      zBaseProxy._callmethodcCs |jdS)z9 Get a copy of the value of the referent z #GETVALUE)r)r$rrr _getvalueszBaseProxy._getvaluec Cs|jrtjd|jjdS|j|jj|jd}t|dd|j ftjd|jj|j j |j |j oj|j j }tj|tj|j|j||j|j |jfdd|_dS)Nz%owned_by_manager skipped INCREF of %r)rWrQz INCREF %r )r5r)rr rsrr#rr"rr9rraddrrrr_decrefrZ_close)r$rr'rrrr s zBaseProxy._increfcCs|j|j|dks |jtjkry2tjd|j||j|d}t|dd|jfWqt k r}ztjd|WYdd}~XqXntjd|j| rt |drtjdt j j |jj|`dS)Nz DECREF %r)rWrRz... decref failed %sz%DECREF %r -- manager already shutdownrz-thread %r has no more proxies so closing conn)discardr#rrrr rsr"r9r{rr]rrrr})rrWr'ZtlsZidsetrrrrrrr s    zBaseProxy._decrefcCsHd|_y |jWn0tk rB}ztjd|WYdd}~XnXdS)Nzincref failed: %s)rrr{r r|)r$rrrrr9s  zBaseProxy._after_forkcCs^i}tdk r|j|d<t|ddrB|j|d<tt|j|j|ffStt||j|j|ffSdS)NrW_isautoFr) r rrr RebuildProxyrrrr)r$r6rrrrAs    zBaseProxy.__reduce__cCs|jS)N)r)r$memorrr __deepcopy__NszBaseProxy.__deepcopy__cCsdt|j|jjt|fS)Nz<%s object, typeid %r at %#x>)rr*rr!r#)r$rrrr+QszBaseProxy.__repr__c Cs4y |jdStk r.t|dddSXdS)zV Return representation of the referent (or a fall-back if that fails) r+Nrz; '__str__()' failed>r)rr{r)r$rrrr@Us zBaseProxy.__str__)NNNTF)r*r,r-r.rr ZForkAwareThreadLockrr%rrrrrrrrrr+r@rrrrrs (   cCsttjdd}|rT|j|jkrTtjd|d|d<|j|jkrT|j|j|j|j<|j ddopttjdd }|||fd|i|S) z5 Function used for unpickling proxy objects. rgNz*Rebuild a proxy owned by manager, token=%rTrrQZ _inheritingF) rr rfr"r rsr#r\rZpop)rErr`r6rrQrrrrbs   rc Csrt|}y |||fStk r(YnXi}x|D]}td||f|q4Wt|tf|}||_||||f<|S)zB Return a proxy type whose methods are given by `exposed` zLdef %s(self, *args, **kwds): return self._callmethod(%r, args, kwds))rrexecrrr)rr_cacheZdicmeth ProxyTyperrr MakeProxyTypews   rTc Cst|d}|dkrB||j|d}zt|dd|f}Wd|jX|dkrX|dk rX|j}|dkrjtjj}td|j |}||||||d} d| _ | S)z* Return an auto-proxy for `token` rN)rWrMz AutoProxy[%s])rrWrQT) rXr"r9r}rr rfrWrr!r) rr`rrWrrQrrrrrrrrs    rc@seZdZddZddZdS) NamespacecKs|jj|dS)N)rupdate)r$r6rrrr%szNamespace.__init__cCs^t|jj}g}x,|D]$\}}|jds|jd||fqW|jd|jjdj|fS)NrGz%s=%rz%s(%s)z, ) rrr startswithrCrr)r*r)r$rrDrrrrrr+s zNamespace.__repr__N)r*r,r-r%r+rrrrrsrc@s8eZdZd ddZddZddZdd ZeeeZd S) ValueTcCs||_||_dS)N) _typecode_value)r$rrlockrrrr%szValue.__init__cCs|jS)N)r)r$rrrrsz Value.getcCs ||_dS)N)r)r$rrrrrsz Value.setcCsdt|j|j|jfS)Nz %s(%r, %r))rr*rr)r$rrrr+szValue.__repr__N)T) r*r,r-r%rrr+rrrrrrrs  rcCs tj||S)N)r)rZsequencerrrrArraysrc@s8eZdZdZddZddZd d Zd d Zd dZdS) IteratorProxy__next__r0throwr}cCs|S)Nr)r$rrr__iter__szIteratorProxy.__iter__cGs |jd|S)Nr)r)r$r5rrrrszIteratorProxy.__next__cGs |jd|S)Nr0)r)r$r5rrrr0szIteratorProxy.sendcGs |jd|S)Nr)r)r$r5rrrrszIteratorProxy.throwcGs |jd|S)Nr})r)r$r5rrrr}szIteratorProxy.closeN)rr0rr}) r*r,r-rrrr0rr}rrrrrs rc@s2eZdZd ZdddZddZd d Zd d ZdS) AcquirerProxyacquirereleaseTNcCs"|dkr|fn||f}|jd|S)Nr )r)r$Zblockingrr5rrrr szAcquirerProxy.acquirecCs |jdS)Nr )r)r$rrrr szAcquirerProxy.releasecCs |jdS)Nr )r)r$rrrrszAcquirerProxy.__enter__cCs |jdS)Nr )r)r$rrrrrrrszAcquirerProxy.__exit__)r r )TN)r*r,r-rr r rrrrrrr s  r c@s4eZdZdZdddZd d Zd d Zdd dZdS)ConditionProxyr r rmnotify notify_allNcCs|jd|fS)Nrm)r)r$rrrrrmszConditionProxy.waitcCs |jdS)Nr )r)r$rrrr szConditionProxy.notifycCs |jdS)Nr)r)r$rrrrszConditionProxy.notify_allcCsh|}|r|S|dk r$tj|}nd}d}x6|sb|dk rP|tj}|dkrPP|j||}q.W|S)Nr)timeZ monotonicrm)r$Z predicaterr8ZendtimeZwaittimerrrwait_fors   zConditionProxy.wait_for)r r rmr r)N)N)r*r,r-rrmr rrrrrrr s  r c@s2eZdZdZddZddZd d Zdd d Zd S) EventProxyrlrrrmcCs |jdS)Nrl)r)r$rrrrlszEventProxy.is_setcCs |jdS)Nr)r)r$rrrrszEventProxy.setcCs |jdS)Nr)r)r$rrrrszEventProxy.clearNcCs|jd|fS)Nrm)r)r$rrrrrmszEventProxy.wait)rlrrrm)N)r*r,r-rrlrrrmrrrrrs rc@sNeZdZdZdddZdd Zd d Zed d ZeddZ eddZ dS) BarrierProxy__getattribute__rmabortresetNcCs|jd|fS)Nrm)r)r$rrrrrm szBarrierProxy.waitcCs |jdS)Nr)r)r$rrrrszBarrierProxy.abortcCs |jdS)Nr)r)r$rrrrszBarrierProxy.resetcCs |jddS)Nrparties)r)r)r$rrrrszBarrierProxy.partiescCs |jddS)Nr n_waiting)r)r)r$rrrrszBarrierProxy.n_waitingcCs |jddS)Nrbroken)r)r)r$rrrrszBarrierProxy.broken)rrmrr)N) r*r,r-rrmrrrrrrrrrrr s   rc@s(eZdZd ZddZddZdd Zd S) NamespaceProxyr __setattr__ __delattr__cCs0|ddkrtj||Stj|d}|d|fS)NrrGrr)objectr)r$r callmethodrrr __getattr__ s   zNamespaceProxy.__getattr__cCs4|ddkrtj|||Stj|d}|d||fS)NrrGrr)rrr)r$rrrrrrr%s  zNamespaceProxy.__setattr__cCs0|ddkrtj||Stj|d}|d|fS)NrrGrr)rrr)r$rrrrrr*s   zNamespaceProxy.__delattr__N)rrr)r*r,r-rrrrrrrrrsrc@s*eZdZdZddZddZeeeZdS) ValueProxyrrcCs |jdS)Nr)r)r$rrrr3szValueProxy.getcCs|jd|fS)Nr)r)r$rrrrr5szValueProxy.setN)rr)r*r,r-rrrrrrrrrr1sr BaseListProxy__add__ __contains__ __delitem__ __getitem____len____mul__ __reversed____rmul__ __setitem__rCcountextendindexinsertrremovereverser__imul__c@seZdZddZddZdS) ListProxycCs|jd|f|S)Nr+)r)r$rrrr__iadd__AszListProxy.__iadd__cCs|jd|f|S)Nr0)r)r$rrrrr0DszListProxy.__imul__N)r*r,r-r2r0rrrrr1@sr1 DictProxyrrrrhas_keypopitem setdefaultrIterator ArrayProxy PoolProxyapply apply_asyncr}imapimap_unorderedrmap map_asyncstarmap starmap_asyncrZ AsyncResult)r;r?rAr<r=c@seZdZddZddZdS)r9cCs|S)Nr)r$rrrrdszPoolProxy.__enter__cCs |jdS)N)r)r$rrrrrrrfszPoolProxy.__exit__N)r*r,r-rrrrrrr9csc@seZdZdZdS)ra( Subclass of `BaseManager` which supports a number of shared object types. The types registered are those intended for the synchronization of threads, plus `dict`, `list` and `Namespace`. The `multiprocessing.Manager()` function creates started instances of this class. N)r*r,r-r.rrrrrms QueueZ JoinableQueuerdr^RLock SemaphoreBoundedSemaphore ConditionBarrierPoolrdictF)rr)r)rrr)NNNT)T)r!r"r#r$r%r&r'r(r)rCr*r+r,r-rr.r/rr0)r"r#r$rr%r)rrrr4rrrr5r6rr)r%r$r)) r:r;r}r<r=rr>r?r@rAr)I__all__rpr]rZqueuerrrrcontextr r r r r rrrZ view_typesrr Z view_typerrr9r2r{r:rFrHrIrrarbZ XmlListenerZ XmlClientrXrrrrrrrrrrrr r rrrrr r1r3rr8Z BasePoolProxyr9rrBrdr^rCrDrErFrGrHrIrrrr s             ; ] 4