%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib64/python2.7/site-packages/tornado/platform/
Upload File :
Create Path :
Current File : //lib64/python2.7/site-packages/tornado/platform/asyncio.pyc

�
��L]c@�s=dZddlmZmZmZmZddlZddlZddl	m
Z
ddlmZddlm
Z
yddlZWn=ek
r�ZyddlZWq�ek
r�e�q�XnXdefd��YZd	efd
��YZdefd��YZd
�Zd�Zee
d�r9e
jeje�ndS(s�Bridges between the `asyncio` module and Tornado IOLoop.

This is a work in progress and interfaces are subject to change.

To test:
python3.4 -m tornado.test.runtests --ioloop=tornado.platform.asyncio.AsyncIOLoop
python3.4 -m tornado.test.runtests --ioloop=tornado.platform.asyncio.AsyncIOMainLoop
(the tests log a few warnings with AsyncIOMainLoop because they leave some
unfinished callbacks on the event loop that fail when it resumes)
i(tabsolute_importtdivisiontprint_functiontwith_statementN(tconvert_yielded(tIOLoop(t
stack_contexttBaseAsyncIOLoopcB�sweZed�Zed�Zd�Zd�Zd�Zd�Zd�Z	d�Z
d�Zd	�Zd
�Z
e
ZRS(cK�sitt|�j|�||_||_|jj|j�i|_t�|_	t�|_
t|_dS(N(
tsuperRt
initializetasyncio_loopt
close_loopt	call_soontmake_currentthandlerstsettreaderstwriterstFalsetclosing(tselfR
Rtkwargs((s>/usr/lib64/python2.7/site-packages/tornado/platform/asyncio.pyR	"s			cC�svt|_xMt|j�D]<}|j|\}}|j|�|r|j|�qqW|jrr|jj�ndS(N(	tTrueRtlistRtremove_handlertclose_fdRR
tclose(Rtall_fdstfdtfileobjthandler_func((s>/usr/lib64/python2.7/site-packages/tornado/platform/asyncio.pyR.s	
	cC�s�|j|�\}}||jkr7td|��n|tj|�f|j|<|tj@r�|jj||j	|tj�|j
j|�n|tj@r�|jj
||j	|tj�|jj|�ndS(Nsfd %s added twice(tsplit_fdRt
ValueErrorRtwrapRtREADR
t
add_readert_handle_eventsRtaddtWRITEt
add_writerR(RRthandlerteventsR((s>/usr/lib64/python2.7/site-packages/tornado/platform/asyncio.pytadd_handler8s
	
	cC�s|j|�\}}|tj@rf||jkr�|jj||j|tj�|jj|�q�n2||jkr�|jj|�|jj	|�n|tj
@r�||jkr|jj||j|tj
�|jj|�qn2||jkr|jj
|�|jj	|�ndS(N(RRR"RR
R#R$R%t
remove_readertremoveR&RR't
remove_writer(RRR)R((s>/usr/lib64/python2.7/site-packages/tornado/platform/asyncio.pytupdate_handlerFs"
	
	cC�s�|j|�\}}||jkr(dS||jkrZ|jj|�|jj|�n||jkr�|jj|�|jj|�n|j|=dS(N(RRRR
R+R,RR-(RRR((s>/usr/lib64/python2.7/site-packages/tornado/platform/asyncio.pyR[scC�s$|j|\}}|||�dS(N(R(RRR)RR((s>/usr/lib64/python2.7/site-packages/tornado/platform/asyncio.pyR$gscC�s|j�|jj�dS(N(t_setup_loggingR
trun_forever(R((s>/usr/lib64/python2.7/site-packages/tornado/platform/asyncio.pytstartks
cC�s|jj�dS(N(R
tstop(R((s>/usr/lib64/python2.7/site-packages/tornado/platform/asyncio.pyR2oscO�sD|jjtd||j��|jtjtj|�||��S(Ni(	R
t
call_latertmaxttimet
_run_callbackt	functoolstpartialRR!(RtwhentcallbacktargsR((s>/usr/lib64/python2.7/site-packages/tornado/platform/asyncio.pytcall_atrs	cC�s|j�dS(N(tcancel(Rttimeout((s>/usr/lib64/python2.7/site-packages/tornado/platform/asyncio.pytremove_timeoutzscO�sJ|jrtd��n|jj|jtjtj|�||��dS(NsIOLoop is closing(	RtRuntimeErrorR
tcall_soon_threadsafeR6R7R8RR!(RR:R;R((s>/usr/lib64/python2.7/site-packages/tornado/platform/asyncio.pytadd_callback}s
		(t__name__t
__module__RR	RR*R.RR$R1R2R<R?RBtadd_callback_from_signal(((s>/usr/lib64/python2.7/site-packages/tornado/platform/asyncio.pyR!s
									tAsyncIOMainLoopcB�seZd�ZRS(cK�s)tt|�jtj�dt|�dS(NR(RRFR	tasynciotget_event_loopR(RR((s>/usr/lib64/python2.7/site-packages/tornado/platform/asyncio.pyR	�s(RCRDR	(((s>/usr/lib64/python2.7/site-packages/tornado/platform/asyncio.pyRF�stAsyncIOLoopcB�seZd�ZRS(cK�s)tt|�jtj�dt|�dS(NR(RRIR	RGtnew_event_loopR(RR((s>/usr/lib64/python2.7/site-packages/tornado/platform/asyncio.pyR	�s(RCRDR	(((s>/usr/lib64/python2.7/site-packages/tornado/platform/asyncio.pyRI�scC�s&tjj�}tjj||�|S(s?Convert an ``asyncio.Future`` to a `tornado.concurrent.Future`.(ttornadot
concurrenttFuturetchain_future(tasyncio_futurettf((s>/usr/lib64/python2.7/site-packages/tornado/platform/asyncio.pytto_tornado_future�scC�s#tj�}tjj||�|S(s?Convert a `tornado.concurrent.Future` to an ``asyncio.Future``.(RGRMRKRLRN(ttornado_futuretaf((s>/usr/lib64/python2.7/site-packages/tornado/platform/asyncio.pytto_asyncio_future�stregister(t__doc__t
__future__RRRRR7ttornado.concurrentRKttornado.genRttornado.ioloopRRRGtImportErrortettrolliusRRFRIRQRTthasattrRURM(((s>/usr/lib64/python2.7/site-packages/tornado/platform/asyncio.pyt<module>
s("
f		

Zerion Mini Shell 1.0