§
    Uä�a	}  ã                   óŠ  — d Z ddlmZmZ ddlmZ ddlZddl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 ddlmZ ddgZ G d„ de¦  «        Z e¦   «         xZZ G d„ de¦  «        Z G d„ de¦  «        Zdd„Zej        d         dk    ree fZ!e"fZ#nddl$Z$e$j!        fZ!e"e$j%        fZ#dZ& G d„ de¦  «        Z'dS )z0
Basic loop implementation for ffi-based cores.
é    )Úabsolute_importÚprint_function)ÚdequeN)Ú_dbg)ÚGEVENT_DEBUG_LEVEL)ÚTRACE©Úcallback)ÚPYPY)ÚHubDestroyed)ÚgetswitchintervalÚAbstractLoopÚassign_standard_callbacksc                   ó   — e Zd Zd„ ZdS )Ú_EVENTSTypec                 ó   — dS )Nzgevent.core.EVENTS© ©Úselfs    ú2/usr/lib/python3/dist-packages/gevent/_ffi/loop.pyÚ__repr__z_EVENTSType.__repr__   s   € Ø#Ð#ó    N)Ú__name__Ú
__module__Ú__qualname__r   r   r   r   r   r      s#   € € € € € ð$ð $ð $ð $ð $r   r   c                   ó   — e Zd ZdZd„ ZdS )Ú_DiscardedSetr   c                 ó   — dS )zDoes nothing.Nr   )r   Úos     r   Údiscardz_DiscardedSet.discard%   s   € € € r   N)r   r   r   Ú	__slots__r    r   r   r   r   r   "   s(   € € € € € Ø€Iðð ð ð ð r   r   c                   ó\   — e Zd Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Ze	sd„ Z
nd„ Z
d	„ Zd
„ Zd„ Zd„ ZdS )ÚAbstractCallbacksc                 ó^   — || _         g | _        t          t          k     r|j        | _        d S d S ©N)ÚffiÚ	callbacksr   r   Úfrom_handle)r   r&   s     r   Ú__init__zAbstractCallbacks.__init__M   s3   € ØˆŒØˆŒÝ¥Ò%Ð%Ø"œˆDÔÐÐð &Ð%r   c                 ó:   — | j                              |¦  «        }|S r%   )r&   r(   )r   ÚhandleÚxs      r   r(   zAbstractCallbacks.from_handleS   s   € ØŒH× Ò  Ñ(Ô(ˆØˆr   c                 óÞ  — d}d}	 |st          d¦  «         dS |                      |¦  «        }|j        }|j        }|j        }|€t
          }|r|d         t          k    r|f|dd…         z   } |j        |Ž  |j        �||j        j        v r|j        |u rdS dS #  	 | n%# t          $ r |                      |¦  «        }Y nw xY wt          j        ¦   «         |_        |j        �|j        €`d}|j        }|`	 |� |j        |g|¢R Ž  n
 | j        |Ž  n5#  t!          dt          j        ¬¦  «         t%          j        ¦   «          Y nxY wY dS |j        j                             |¦  «         Y dS xY w)	a­  
        Returns an integer having one of three values:

        - -1
          An exception occurred during the callback and you must call
          :func:`_python_handle_error` to deal with it. The Python watcher
          object will have the exception tuple saved in ``_exc_info``.
        - 1
          Everything went according to plan. You should check to see if the native
          watcher is still active, and call :func:`python_stop` if it is not. This will
          clean up the memory. Finding the watcher still active at the event loop level,
          but not having stopped itself at the gevent level is a buggy scenario and
          shouldn't happen.
        - 2
          Everything went according to plan, but the watcher has already
          been stopped. Its memory may no longer be valid.

        This function should never return 0, as that's the default value that
        Python exceptions will produce.
        Nzpython_callback got null handleé   r   é   z*WARNING: gevent: Error when handling error©Úfileéÿÿÿÿ)r   r(   Ú_watcherÚloopÚargsÚ_NOARGSÚGEVENT_CORE_EVENTSr
   Ú_keepalivesetÚUnboundLocalErrorÚsysÚexc_infoÚ	_exc_infoÚ_handleÚhandle_errorÚunhandled_onerrorÚprintÚstderrÚ	tracebackÚ	print_excÚadd)r   r+   ÚreventsÚorig_ffi_watcherÚ	orig_loopÚthe_watcherr5   r;   s           r   Úpython_callbackz!AbstractCallbacks.python_callbackW   s  € ð,  ÐØˆ	ðS	ð ð õ Ð6Ñ7Ô7Ð7Ø�qØ×*Ò*¨6Ñ2Ô2ˆKØ*Ô3ÐØ#Ô(ˆIØÔ#ˆDØˆ|õ �Øð .˜˜QœÕ#5Ò5Ð5Ø�{ T¨!¨"¨"¤XÑ-�Ø ˆKÔ  $Ð'Ð'ð` Ô Ð,Ø# {Ô'7Ô'EÐEÐEØ#Ô,Ð0@Ð@Ð@ð �qØ�1øðw-	ð7Ø��øÝ$ð 7ð 7ð 7Ø"×.Ò.¨vÑ6Ô6���ð7øøøõ %(¤L¡N¤NˆKÔ!ð  Ô$Ð,à"Ô*Ð2ð �Ø&Ô0�ØÐ)ð*Ø Ð,Ø.˜	Ô.¨{ÐF¸XÐFÐFÐFÐFÐFà.˜Ô.°Ð9Ð9øøð*ÝÐFÝ"œzð+ñ +ô +ð +åÔ'Ñ)Ô)Ð)Ð)Ð)øøøà�q�qð ÔÔ*×.Ò.¨{Ñ;Ô;Ð;Ø�2�2øøøsS   †B ™AB ÂE,ÂBÂE,ÂCÂ>E,Ã CÃ4E,Ã6DÄE,Ä0EÅE,Å
E,c                 ó¦  — t          d|¦  «         |sd S 	 |                      |¦  «        }|j        }|` |j        j        d g|¢R Ž  	 |                     ¦   «          n+#   |j        j        |gt          j        ¦   «         ¢R Ž  Y nxY wd S # 	 |                     ¦   «          n+#   |j        j        |gt          j        ¦   «         ¢R Ž  Y nxY w Y d S xY w)NzHandling error for handle)r   r(   r<   r4   r>   Ústopr:   r;   )r   r+   Ú_reventsÚwatcherr;   s        r   Úpython_handle_errorz%AbstractCallbacks.python_handle_errorÄ   s
  € ÝÐ(¨&Ñ1Ô1Ð1Øð 	ØˆFð	Ø×&Ò& vÑ.Ô.ˆGØÔ(ˆHØÐ!ð &ˆGŒLÔ% dÐ6¨XÐ6Ð6Ð6Ð6ðDØ—’‘”��øðDØ)�”Ô)¨'ÐCµC´L±N´NÐCÐCÐCÐCÐCÐCøøøØˆFøð	DØ—’‘”��øðDØ)�”Ô)¨'ÐCµC´L±N´NÐCÐCÐCÐCÐCÐCøøøØˆFˆFˆFˆFˆFˆFs/   –1B
 ÁA Á&BÂ
CÂB!Â CÂ!&C	ÃCc                 ó"  — d }|�|j         j                             d¦  «        nd }|r|                      |¦  «        }|�|j                             d |||¦  «         dS t          dt          j        ¬¦  «         t          j
        |||¦  «         d S )Nr+   r.   z0WARNING: gevent: Unhandled error with no watcherr0   )Útb_frameÚf_localsÚgetr(   r4   r>   r@   r:   rA   rB   Úprint_exception)r   ÚtÚvÚtbrM   r+   s         r   r?   z#AbstractCallbacks.unhandled_onerrorä   s¨   € ð ˆØ79°~�”Ô%×)Ò)¨(Ñ3Ô3Ð3È4ˆØð 	/Ø×&Ò& vÑ.Ô.ˆGØÐØŒL×%Ò% d¨A¨q°"Ñ5Ô5Ð5Ø�1õ 	Ð@Ý”:ð	ñ 	ô 	ð 	åÔ! ! Q¨Ñ+Ô+Ð+Ð+Ð+r   c                 ó–   — |st          dt          j        ¬¦  «         d S |                      |¦  «        }|                     ¦   «          d S )Nz„WARNING: gevent: Unable to dereference handle; not stopping watcher. Native resources may leak. This is most likely a bug in gevent.r0   )r@   r:   rA   r(   rK   )r   r+   rM   s      r   Úpython_stopzAbstractCallbacks.python_stopÿ   sW   € Øð 		ÝðRå”Zð!ñ !ô !ð !ð ˆFØ×"Ò" 6Ñ*Ô*ˆØ�Š‰Œˆˆˆr   c                 ó   — d S r%   r   ©r   Úwatcher_ptrs     r   Úpython_check_callbackz'AbstractCallbacks.python_check_callback  s	   € ð ˆDr   c                 óB   — 	 t          ¦   «         ‚# t           $ r Y d S w xY wr%   )ÚMemoryErrorrZ   s     r   r\   z'AbstractCallbacks.python_check_callback  s3   € ðÝ!‘m”mÐ#øÝð ð ð Ø��ðøøøs   ‚ �
�c                 ó€   — |                       |¦  «        }|€t          d|¦  «         d S |                     ¦   «          d S )NzDWARNING: gevent: running prepare callbacks from a destroyed handle: )Ú_find_loop_from_c_watcherr@   Ú_run_callbacks)r   r[   r4   s      r   Úpython_prepare_callbackz)AbstractCallbacks.python_prepare_callback(  sO   € Ø×-Ò-¨kÑ:Ô:ˆØˆ<ÝÐXØñô ð àˆFØ×ÒÑÔÐÐÐr   c                 ó–   — |                       |¦  «        }|r|                      |¦  «        }|�|                     d |||¦  «         d S |‚r%   )Ú_find_watcher_ptr_in_tracebackr`   r>   )r   rT   rU   rV   r[   r4   s         r   Úcheck_callback_onerrorz(AbstractCallbacks.check_callback_onerror0  s\   € Ø×9Ò9¸"Ñ=Ô=ˆØð 	?Ø×1Ò1°+Ñ>Ô>ˆDØÐð ×Ò˜d A q¨"Ñ-Ô-Ð-Ø�4Øˆr   c                 ó   — t          ¦   «         ‚r%   ©ÚNotImplementedErrorrZ   s     r   r`   z+AbstractCallbacks._find_loop_from_c_watcher;  ó   € Ý!Ñ#Ô#Ð#r   c                 ó.   — |�|j         j        d         nd S )Nr[   )rP   rQ   )r   rV   s     r   rd   z0AbstractCallbacks._find_watcher_ptr_in_traceback>  s   € Ø68°nˆrŒ{Ô# MÔ2Ð2È$ÐNr   N)r   r   r   r)   r(   rI   rN   r?   rX   r   r\   rb   re   r`   rd   r   r   r   r#   r#   J   sá   € € € € € ð/ð /ð /ðð ð ðkð kð kðZð ð ð@,ð ,ð ,ð6ð ð ð ð ð	ð 	ð 	ð 	ð"	ð 	ð 	ðð ð ð	ð 	ð 	ð$ð $ð $ðOð Oð Oð Oð Or   r#   r   c                 ój  ‡—  || ¦  «        Šd„ |D ¦   «         }t          ˆfd„|D ¦   «         ¦  «        }‰j        df‰j        df‰j        df‰j        ‰j        f‰j        ‰j        ff|z   D ]G\  }}|p‰j        } |                      |¬¦  «        |¦  «        }‰j	         
                    |¦  «         ŒH‰S )a4  
    Given the typical *ffi* and *lib* arguments, and a subclass of :class:`AbstractCallbacks`
    in *callbacks_class*, set up the ``def_extern`` Python callbacks from C
    into an instance of *callbacks_class*.

    :param tuple extras: If given, this is a sequence of ``(name, error_function)``
      additional callbacks to register. Each *name* is an attribute of
      the *callbacks_class* instance. (Each element cas also be just a *name*.)
    :return: The *callbacks_class* instance. This object must be kept alive,
      typically at module scope.
    c                 ó@   — g | ]}t          |¦  «        d k    r|n|df‘ŒS )r/   N)Úlen)Ú.0Úextras     r   ú
<listcomp>z-assign_standard_callbacks.<locals>.<listcomp>P  s.   € ÐNÐNÐN¸e•s˜5‘z”z Q’�ˆeˆe¨U°D¨MÐNÐNÐNr   c              3   óB   •K  — | ]\  }}t          ‰|¦  «        |fV — Œd S r%   )Úgetattr)rn   ÚnameÚerrorr'   s      €r   ú	<genexpr>z,assign_standard_callbacks.<locals>.<genexpr>Q  s6   øè è € ÐOÐO¹¸¸u•G˜I tÑ,Ô,¨eÐ4ÐOÐOÐOÐOÐOÐOr   N)Úonerror)ÚtuplerI   rN   rX   r\   re   rb   r?   Ú
def_externr'   Úappend)r&   ÚlibÚcallbacks_classÚextrasÚfuncÚ
error_funcr
   r'   s          @r   r   r   B  sö   ø€ ð  � Ñ$Ô$€IØNÐNÀvÐNÑNÔN€FÝÐOÐOÐOÐOÈÐOÑOÔOÑOÔO€FàÔ&¨Ð-ØÔ*¨DÐ1ØÔ" DÐ)ØÔ,¨iÔ.NÐOØÔ.°	Ô0PÐQðð 	ñð -ð -Ñˆˆzð  Ð> 9Ô#>ˆ
Ø5�3—>’>¨*�>Ñ5Ô5°dÑ;Ô;ˆð
 	Ô×"Ò" 8Ñ,Ô,Ð,Ð,ð
 Ðr   é   c                   óš  — e Zd ZdZdZdZdZdZdZdZ	dZ
 e¦   «         ZdZdBd„ZdBd„Zd„ Zd„ Zd„ Zd	„ Zd
„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zed„ ¦   «         Zed„ ¦   «         Zed„ ¦   «         Zed„ ¦   «         Z d„ Z!d„ Z"d„ Z#dCd„Z$d„ Z%d„ Z&d„ Z'dDd„Z(d„ Z)d„ Z*d „ Z+d!„ Z,d"„ Z-ed#„ ¦   «         Z.ed$„ ¦   «         Z/ed%„ ¦   «         Z0ed&„ ¦   «         Z1ed'„ ¦   «         Z2ed(„ ¦   «         Z3dEd*„Z4d+„ Z5dFd-„Z6dEd.„Z7dEd/„Z8dEd0„Z9dEd1„Z:dEd2„Z;dEd3„Z<e< e=¦   «         d4<   e>j?        d5k    rdGd7„Z@d8„ ZAdFd9„ZBdDd:„ZCd;„ ZDd<„ ZEd=„ ZFd>„ ZGd?„ ZHd@„ ZIedA„ ¦   «         ZJdS )Hr   é2   NFc                 ó  — || _         || _        d | _        | j                              | ¦  «        | _        || _        d| _        t          ¦   «         | _        t          ¦   «         | _
        |                      ||¦  «         d S ©NF)Ú_ffiÚ_libÚ_ptrÚ
new_handleÚ_handle_to_selfÚ	_watchersÚ_in_callbackr   Ú
_callbacksÚsetr8   Ú_init_loop_and_aux_watchers)r   r&   rz   ÚwatchersÚflagsÚdefaults         r   r)   zAbstractLoop.__init__�  sq   € ØˆŒ	ØˆŒ	ØˆŒ	Ø#œy×3Ò3°DÑ9Ô9ˆÔØ!ˆŒØ!ˆÔÝ™'œ'ˆŒå ™UœUˆÔØ×(Ò(¨°Ñ8Ô8Ð8Ð8Ð8r   c                 ó^  — |                       ||¦  «        | _        | j                             | j        ¦  «        | _        | j        | j        _        |                      ¦   «          | j                             | j	        ¦  «        | _
        | j        | j
        _        |                      ¦   «          | j                             | j        ¦  «        | _        | j        | j        _        |                      ¦   «          |                      d¬¦  «        | _        | j                             d„ ¦  «         d S )NF)Úrefc                  ó   — d S r%   r   r   r   r   ú<lambda>z:AbstractLoop._init_loop_and_aux_watchers.<locals>.<lambda>¼  s   € ¨T€ r   )Ú
_init_loopr†   r„   ÚnewÚ_CHECK_POINTERÚ_checkrˆ   ÚdataÚ_init_and_start_checkÚ_PREPARE_POINTERÚ_prepareÚ_init_and_start_prepareÚ_TIMER_POINTERÚ_timer0Ú_init_callback_timerÚasync_Ú_threadsafe_asyncÚstart©r   r�   r�   s      r   r�   z(AbstractLoop._init_loop_and_aux_watchers›  sù   € Ø—O’O E¨7Ñ3Ô3ˆŒ	ð ”i—m’m DÔ$7Ñ8Ô8ˆŒØÔ/ˆŒÔØ×"Ò"Ñ$Ô$Ð$ð œ	Ÿš dÔ&;Ñ<Ô<ˆŒØ!Ô1ˆŒÔØ×$Ò$Ñ&Ô&Ð&ð ”y—}’} TÔ%8Ñ9Ô9ˆŒØ Ô0ˆŒÔØ×!Ò!Ñ#Ô#Ð#à!%§¢° Ñ!7Ô!7ˆÔð 	Ô×$Ò$ \ \Ñ2Ô2Ð2Ð2Ð2r   c                 ó   — t          ¦   «         ‚)zs
        Called by __init__ to create or find the loop. The return value
        is assigned to self._ptr.
        rg   r¤   s      r   r•   zAbstractLoop._init_loopÁ  s   € õ
 "Ñ#Ô#Ð#r   c                 ó   — t          ¦   «         ‚r%   rg   r   s    r   rš   z"AbstractLoop._init_and_start_checkÈ  ri   r   c                 ó   — t          ¦   «         ‚r%   rg   r   s    r   r�   z$AbstractLoop._init_and_start_prepareË  ri   r   c                 ó   — t          ¦   «         ‚r%   rg   r   s    r   r    z!AbstractLoop._init_callback_timerÎ  ri   r   c                 ó   — t          ¦   «         ‚r%   rg   r   s    r   Ú_stop_callback_timerz!AbstractLoop._stop_callback_timerÑ  ri   r   c                 ó   — t          ¦   «         ‚r%   rg   r   s    r   Ú_start_callback_timerz"AbstractLoop._start_callback_timerÔ  ri   r   c                 ó6   — |                       d |||¦  «         d S r%   )r>   )r   rT   rU   rV   s       r   Ú_check_callback_handle_errorz)AbstractLoop._check_callback_handle_error×  s"   € Ø×Ò˜$  1 bÑ)Ô)Ð)Ð)Ð)r   c                 óf  — d| _         	 | j        }|                      ¦   «         }|t          ¦   «         z   }|                      ¦   «          | j        �r| j                             ¦   «         }|dz  }|                      ¦   «          |j        }d |_        |j	        }|�|€ŒT	  ||Ž  nf#  	  | j
        |gt          j        ¦   «         ¢R Ž  n>#  	 t          dt          j        ¬¦  «         t          j        ¦   «          n#  Y nxY wY nxY wY nxY wd |_	        n# d |_	        w xY w|dk    r=| j        r6| j        }|                      ¦   «          |                      ¦   «         |k    rd}n| j        �°|dk    r|                      ¦   «          | j        r|                      ¦   «          d| _         d S # d| _         w xY w)NTr.   z&Exception while handling another errorr0   r   F)Ú#starting_timer_may_update_loop_timeÚCALLBACK_CHECK_COUNTÚnowr   rª   r‹   ÚpopleftÚunrefr
   r5   r>   r:   r;   r@   rA   rB   rC   Ú
update_nowr¬   )r   Úcountr²   Ú
expirationÚcbr
   r5   s          r   ra   zAbstractLoop._run_callbacksÚ  sò  € ð 48ˆÔ0ðB	=ØÔ-ˆEØ—(’(‘*”*ˆCØÕ0Ñ2Ô2Ñ2ˆJØ×%Ò%Ñ'Ô'Ð'Ø”/ñ 3Ø”_×,Ò,Ñ.Ô.�Ø˜‘
�Ø—
’
‘”�Øœ;�Ø"�”Ø”w�ØÐ# t |àð#Ø�H˜d�O�O�Oøð!ð !Ø)˜Ô)¨"Ð>­s¬|©~¬~Ð>Ð>Ð>Ð>Ð>øð!ð!Ý!Ð"JÕQTÔQ[Ð\Ñ\Ô\Ð\Ý%Ô/Ñ1Ô1Ð1Ð1øð!Ø ˜Døøøøøøøøøøøøøð
 #�B”G�Gø˜d�B”G�N�N�N�Nð
 ˜A’:�: $¤/�:Ø Ô5�EØ—O’OÑ%Ô%Ð%Ø—x’x‘z”z ZÒ/Ð/Ø˜Øðg ”/ñ 3ðn �aŠxˆxØ—’Ñ!Ô!Ð!àŒð -Ø×*Ò*Ñ,Ô,Ð,à7<ˆDÔ4Ð4Ð4ø°uˆDÔ4Ð<Ð<Ð<Ð<sg   ‰BF' ÂB$ Â#D Â$DÂ'CÃDÃDÃ
.C9Ã8DÃ9C=Ã;DÄ DÄD Ä
F' Ä	DÄBF' Æ'	F0c                 óX   — | j         �"| j                              ¦   «          d | _         d S d S r%   )r¢   Úcloser   s    r   Ú_stop_aux_watcherszAbstractLoop._stop_aux_watchers*  s6   € ØÔ!Ð-ØÔ"×(Ò(Ñ*Ô*Ð*Ø%)ˆDÔ"Ð"Ð"ð .Ð-r   c                 óú   — | j         }|rq	 |                      |¦  «        s	 d | _        | `| `| `dS |                      ¦   «          |                      |¦  «         d | _        | `| `| `n# d | _        | `| `| `w xY wdS d S )NFT)ÚptrÚ_can_destroy_loopr†   rˆ   r‹   r8   r»   Ú_destroy_loop©r   r½   s     r   ÚdestroyzAbstractLoop.destroy/  sÊ   € ØŒhˆØð 	ð'Ø×-Ò-¨cÑ2Ô2ð !Ø ð !�”	ØÐ(Ø�OØÐ&Ð&Ð&ð ×'Ò'Ñ)Ô)Ð)Ø×"Ò" 3Ñ'Ô'Ð'ð
 !�”	ØÐ(Ø�OØÐ&Ð&øð !�”	ØÐ(Ø�OØÐ&Ð&Ð&Ð&Ð&à�4ð	ð 	s   ‹A' °)A' Á'A6c                 ó   — t          ¦   «         ‚r%   rg   rÀ   s     r   r¾   zAbstractLoop._can_destroy_loopB  ri   r   c                 ó   — t          ¦   «         ‚r%   rg   rÀ   s     r   r¿   zAbstractLoop._destroy_loopE  ri   r   c                 ó   — | j         S r%   )r†   r   s    r   r½   zAbstractLoop.ptrH  s   € ð ŒyÐr   c                 ó   — | j         j        S r%   )r‰   rM   r   s    r   ÚWatcherTypezAbstractLoop.WatcherTypeM  s   € àŒ~Ô%Ð%r   c                 ó   — dS ©Nr.   r   r   s    r   ÚMAXPRIzAbstractLoop.MAXPRIQ  ó   € àˆqr   c                 ó   — dS rÈ   r   r   s    r   ÚMINPRIzAbstractLoop.MINPRIU  rÊ   r   c                 ó   — 	 t          j        |¦  «        }n#  t          j        ¦   «          Y nxY w	 |›d|›�}n#  t          j        ¦   «          Y nxY w|                      d t
          t          |¦  «        d ¦  «         d S )Nz: )ÚosÚstrerrorrB   rC   r>   ÚSystemError)r   ÚmessageÚerrnos      r   Ú_handle_syserrzAbstractLoop._handle_syserrY  s“   € ð	"Ý”K Ñ&Ô&ˆEˆEøð	"ÝÔÑ!Ô!Ð!Ð!Ð!øøøð	"Ø") ' '¨5¨5Ð1ˆGˆGøð	"ÝÔÑ!Ô!Ð!Ð!Ð!øøøØ×Ò˜$¥­[¸Ñ-AÔ-AÀ4ÑHÔHÐHÐHÐHs   ‚ —.²: ºAc                 óþ   — |t           u r/| j                             ¦   «          |                      ¦   «          d S d }| j        }|�!t          |d|¦  «        } |||||¦  «         d S |                      ||||¦  «         d S )Nr>   )r   r‹   ÚclearÚbreak_Úerror_handlerrr   Ú_default_handle_error)r   ÚcontextÚtypeÚvaluerV   r>   r×   s          r   r>   zAbstractLoop.handle_errord  s“   € Ø•<ÐÐØŒO×!Ò!Ñ#Ô#Ð#Ø�KŠK‰MŒMˆMØˆFàˆØÔ*ˆØÐ$å" =°.À-ÑPÔPˆLØˆL˜ $¨¨rÑ2Ô2Ð2Ð2Ð2à×&Ò& w°°e¸RÑ@Ô@Ð@Ð@Ð@r   c                 ó2   — t          j        |||¦  «         d S r%   )rB   rS   )r   rÙ   rÚ   rÛ   rV   s        r   rØ   z"AbstractLoop._default_handle_errors  s   € õ 	Ô! $¨¨rÑ2Ô2Ð2Ð2Ð2r   c                 ó   — t          ¦   «         ‚r%   rg   )r   ÚnowaitÚonces      r   ÚrunzAbstractLoop.runz  ri   r   c                 ó   — t          ¦   «         ‚r%   rg   r   s    r   ÚreinitzAbstractLoop.reinit}  ri   r   c                 ó   — t          ¦   «         ‚r%   rg   r   s    r   r’   zAbstractLoop.ref€  s   € å!Ñ#Ô#Ð#r   c                 ó   — t          ¦   «         ‚r%   rg   r   s    r   r´   zAbstractLoop.unref„  ri   r   c                 ó   — t          ¦   «         ‚r%   rg   )r   Úhows     r   rÖ   zAbstractLoop.break_‡  ri   r   c                 ó   — d S r%   r   r   s    r   ÚverifyzAbstractLoop.verifyŠ  s   € Øˆr   c                 ó   — t          ¦   «         ‚r%   rg   r   s    r   r²   zAbstractLoop.now�  ri   r   c                 ó   — t          ¦   «         ‚r%   rg   r   s    r   rµ   zAbstractLoop.update_now�  ri   r   c                 óp   — dd l }|                     dt          d¬¦  «         |                      ¦   «          d S )Nr   z('update' is deprecated; use 'update_now'r/   )Ú
stacklevel)ÚwarningsÚwarnÚDeprecationWarningrµ   )r   rí   s     r   ÚupdatezAbstractLoop.update“  sG   € ØˆˆˆØ�ŠÐ@Ý(Ø!"ð 	ñ 	$ô 	$ð 	$ð 	�ŠÑÔÐÐÐr   c                 óz   — d| j         j        | j         j        t          | ¦  «        |                      ¦   «         fz  S )Nz<%s.%s at 0x%x %s>)Ú	__class__r   r   ÚidÚ_formatr   s    r   r   zAbstractLoop.__repr__š  s8   € Ø#ØŒNÔ%ØŒNÔ#Ýˆt‰HŒHØ�LŠL‰NŒNð	'
ñ 
ð 	
r   c                 ó"   — | j         r| j        ndS rƒ   )r½   Ú_defaultr   s    r   r�   zAbstractLoop.default¢  s   € à $¤Ð3ˆtŒ}ˆ}¨eÐ3r   c                 ó   — dS ©Nr2   r   r   s    r   Ú	iterationzAbstractLoop.iteration¦  ó   € àˆrr   c                 ó   — dS rø   r   r   s    r   ÚdepthzAbstractLoop.depthª  rú   r   c                 ó   — dS ©Nr   r   r   s    r   Úbackend_intzAbstractLoop.backend_int®  rÊ   r   c                 ó   — dS )Nr�   r   r   s    r   ÚbackendzAbstractLoop.backend²  s   € àˆyr   c                 ó   — dS rþ   r   r   s    r   Ú
pendingcntzAbstractLoop.pendingcnt¶  rÊ   r   Tc                 ó>   — | j                              | ||||¦  «        S r%   )r‰   Úio)r   ÚfdÚeventsr’   Úprioritys        r   r  zAbstractLoop.ioº  s    € ØŒ~× Ò   r¨6°3¸ÑAÔAÐAr   c                 ó   — dS rƒ   r   )r   r  s     r   Ú
closing_fdzAbstractLoop.closing_fd½  s   € Øˆur   ç        c                 ó>   — | j                              | ||||¦  «        S r%   )r‰   Útimer)r   ÚafterÚrepeatr’   r  s        r   r  zAbstractLoop.timerÀ  s    € ØŒ~×#Ò# D¨%°¸¸hÑGÔGÐGr   c                 ó<   — | j                              | |||¦  «        S r%   )r‰   Úsignal)r   Úsignumr’   r  s       r   r  zAbstractLoop.signalÃ  s   € ØŒ~×$Ò$ T¨6°3¸ÑAÔAÐAr   c                 ó:   — | j                              | ||¦  «        S r%   )r‰   Úidle©r   r’   r  s      r   r  zAbstractLoop.idleÆ  ó   € ØŒ~×"Ò" 4¨¨hÑ7Ô7Ð7r   c                 ó:   — | j                              | ||¦  «        S r%   )r‰   Úpreparer  s      r   r  zAbstractLoop.prepareÉ  s   € ØŒ~×%Ò% d¨C°Ñ:Ô:Ð:r   c                 ó:   — | j                              | ||¦  «        S r%   )r‰   Úcheckr  s      r   r  zAbstractLoop.checkÌ  s   € ØŒ~×#Ò# D¨#¨xÑ8Ô8Ð8r   c                 ó:   — | j                              | ||¦  «        S r%   )r‰   Úforkr  s      r   r  zAbstractLoop.forkÏ  r  r   c                 ó:   — | j                              | ||¦  «        S r%   )r‰   r¡   r  s      r   r¡   zAbstractLoop.async_Ò  s   € ØŒ~×$Ò$ T¨3°Ñ9Ô9Ð9r   ÚasyncÚwin32r   c                 ó<   — | j                              | |||¦  «        S r%   )r‰   Úchild)r   ÚpidÚtracer’   s       r   r!  zAbstractLoop.childÚ  s   € Ø”>×'Ò'¨¨c°5¸#Ñ>Ô>Ð>r   c                 ó   — d S r%   r   r   s    r   Úinstall_sigchldzAbstractLoop.install_sigchldÝ  s   € ØˆDr   c                 ó>   — | j                              | ||||¦  «        S r%   )r‰   Ústat)r   ÚpathÚintervalr’   r  s        r   r'  zAbstractLoop.statà  s    € ØŒ~×"Ò" 4¨¨x¸¸hÑGÔGÐGr   c                 ó"   — t          | |¦  «        S r%   r	   )r   r  s     r   r
   zAbstractLoop.callbackã  s   € Ý˜˜hÑ'Ô'Ð'r   c                 ó   — t          ¦   «         ‚r%   rg   r   s    r   Ú_setup_for_run_callbackz$AbstractLoop._setup_for_run_callbackæ  ri   r   c                 ó‚   — t          ||¦  «        }| j                             |¦  «         |                      ¦   «          |S r%   )r
   r‹   ry   r,  ©r   r}   r5   r¸   s       r   Úrun_callbackzAbstractLoop.run_callbacké  s@   € õ �d˜DÑ!Ô!ˆØŒ×Ò˜rÑ"Ô"Ð"Ø×$Ò$Ñ&Ô&Ð&Øˆ	r   c                 óT   —  | j         |g|¢R Ž }| j                             ¦   «          |S r%   )r/  r¢   Úsendr.  s       r   Úrun_callback_threadsafez$AbstractLoop.run_callback_threadsafeò  s6   € ØˆTÔ˜tÐ+ dÐ+Ð+Ð+ˆØÔ×#Ò#Ñ%Ô%Ð%Øˆ	r   c                 óº   — | j         }|sdS d| j        z   }|dt          |¦  «        z   z  }| j        r|dz  }|d| j        z  z  }||                      ¦   «         z  }|S )NÚ	destroyedzbackend=z ptr=z defaultz pending=%s)r½   r  Ústrr�   r  Ú_format_details)r   r½   Úmsgs      r   rô   zAbstractLoop._format÷  sw   € ØŒhˆØð 	Ø�;Ø˜4œ<Ñ'ˆØˆw�˜S™œÑ!Ñ!ˆØŒ<ð 	Ø�:ÑˆCØˆ}˜tœÑ.Ñ.ˆØˆt×#Ò#Ñ%Ô%Ñ%ˆØˆ
r   c                 ó  — d}|                       ¦   «         }	 | j        }n# t          $ r d }Y nw xY w|�|dt          |¦  «        z   z  }|�|dt          |¦  «        z   z  }|dt	          t          | j        ¦  «        ¦  «        z   z  }|S )NÚ z ref=z fileno=z callbacks=)ÚfilenoÚ	activecntÚAttributeErrorÚreprr5  rm   r‹   )r   r7  r:  r;  s       r   r6  zAbstractLoop._format_details  s¤   € ØˆØ—’‘”ˆð	ØœˆIˆIøÝð 	ð 	ð 	ØˆIˆIˆIð	øøøàÐ Ø�7�T )™_œ_Ñ,Ñ,ˆCØÐØ�:¥ V¡¤Ñ,Ñ,ˆCð 	ˆ}�s¥3 t¤Ñ#7Ô#7Ñ8Ô8Ñ8Ñ8ˆØˆ
s   ˜   /®/c                 ó   — d S r%   r   r   s    r   r:  zAbstractLoop.fileno  s   € Øˆtr   c                 ó2   — | j         st          d¦  «        ‚dS )Nzoperation on destroyed loopr   )r½   Ú
ValueErrorr   s    r   r;  zAbstractLoop.activecnt  s    € àŒxð 	<ÝÐ:Ñ;Ô;Ð;Øˆqr   )NN)FFr%   )TN)r  TN)r   T)Kr   r   r   r±   r×   r—   rž   Ú_TIMER_CALLBACK_SIGr›   r°   rö   r   r8   r¢   r)   r�   r•   rš   r�   r    rª   r¬   r®   ra   r»   rÁ   r¾   r¿   Úpropertyr½   rÆ   rÉ   rÌ   rÓ   r>   rØ   rà   râ   r’   r´   rÖ   rè   r²   rµ   rð   r   r�   rù   rü   rÿ   r  r  r  r
  r  r  r  r  r  r  r¡   Úlocalsr:   Úplatformr!  r%  r'  r
   r,  r/  r2  rô   r6  r:  r;  r   r   r   r   r   v  sµ  € € € € € ð
 Ðà€Mà€Nà€NØÐàÐà*/Ð'ð €Hà!�M‘O”O€MØÐð
9ð 
9ð 
9ð 
9ð!3ð !3ð !3ð !3ðL$ð $ð $ð$ð $ð $ð$ð $ð $ð$ð $ð $ð$ð $ð $ð$ð $ð $ð*ð *ð *ðN=ð N=ð N=ð`*ð *ð *ð
ð ð ð&$ð $ð $ð$ð $ð $ð ðð ñ „Xðð ð&ð &ñ „Xð&ð ðð ñ „Xðð ðð ñ „Xðð	Ið 	Ið 	IðAð Að Að3ð 3ð 3ð$ð $ð $ð $ð$ð $ð $ð$ð $ð $ð$ð $ð $ð$ð $ð $ð $ðð ð ð$ð $ð $ð$ð $ð $ðð ð ð
ð 
ð 
ð ð4ð 4ñ „Xð4ð ðð ñ „Xðð ðð ñ „Xðð ðð ñ „Xðð ðð ñ „Xðð ðð ñ „XððBð Bð Bð Bðð ð ðHð Hð Hð HðBð Bð Bð Bð8ð 8ð 8ð 8ð;ð ;ð ;ð ;ð9ð 9ð 9ð 9ð8ð 8ð 8ð 8ð:ð :ð :ð :ð €F€F�H„HˆWÑà
„|�wÒÐð	?ð 	?ð 	?ð 	?ð	ð 	ð 	ðHð Hð Hð Hð(ð (ð (ð (ð$ð $ð $ðð ð ðð ð ð

ð 
ð 
ðð ð ð ð ð ð ðð ñ „Xðð ð r   )r   )(Ú__doc__Ú
__future__r   r   Úcollectionsr   r:   rÎ   rB   Úgevent._ffir   r   r   Úgevent._ffi.callbackr
   Úgevent._compatr   Úgevent.exceptionsr   Úgeventr   Ú__all__Úobjectr   ÚEVENTSr7   Ú	frozensetr   r#   r   Úversion_infoÚbytesr5  Ú
basestringÚintÚinteger_typesÚ__builtin__Úlongr6   r   r   r   r   ú<module>rX     s.  ððð ð 7Ð 6Ð 6Ð 6Ð 6Ð 6Ð 6Ð 6à Ð Ð Ð Ð Ð Ø 
€
€
€
Ø 	€	€	€	Ø Ð Ð Ð à Ð Ð Ð Ð Ð Ø *Ð *Ð *Ð *Ð *Ð *Ø Ð Ð Ð Ð Ð Ø )Ð )Ð )Ð )Ð )Ð )Ø Ð Ð Ð Ð Ð Ø *Ð *Ð *Ð *Ð *Ð *à $Ð $Ð $Ð $Ð $Ð $ð Øð€ð$ð $ð $ð $ð $�&ñ $ô $ð $ð *˜k™mœmÐ +€Ð	ðð ð ð ð �Iñ ô ð ðPuOð uOð uOð uOð uO˜ñ uOô uOð uOðp#ð #ð #ð #ðL Ô�AÔ˜!ÒÐØ˜�€JØ�F€M€MàÐÐÐØÔ(Ð*€JØ˜+Ô*Ð+€Mð
 €ðdð dð dð dð d�6ñ dô dð dð dð dr   