← back to Atmos Game

assets/gen/.venv/lib/python3.12/site-packages/anyio/streams/__pycache__/stapled.cpython-312.pyc

68 lines

�

c�bj���6�ddlmZdZddlmZmZmZddlmZddl	m
Z
mZmZddl
mZmZmZmZmZmZmZmZed�Zed	�Zed
��Gd�d
e��Zed
��Gd�deeee��Zed
��Gd�deeee��Zy)�)�annotations)�
MultiListener�StapledByteStream�StapledObjectStream)�Callable�Mapping�Sequence)�	dataclass)�Any�Generic�TypeVar�)�ByteReceiveStream�ByteSendStream�
ByteStream�Listener�ObjectReceiveStream�ObjectSendStream�ObjectStream�	TaskGroup�T_Item�T_StreamF)�eqc�Z�eZdZUdZded<ded<dd
d�Zdd�Zdd�Zdd	�Ze	dd
��Z
y)raV
    Combines two byte streams into a single, bidirectional byte stream.

    Extra attributes will be provided from both streams, with the receive stream
    providing the values in case of a conflict.

    :param ByteSendStream send_stream: the sending byte stream
    :param ByteReceiveStream receive_stream: the receiving byte stream
    r�send_streamr�receive_streamc��tK�|dkrtd��|jj|��d{���S7��w)N�z$max_bytes must be a positive integer)�
ValueErrorr�receive)�self�	max_bytess  �l/Users/macstudio3/Projects/atmos-game/assets/gen/.venv/lib/python3.12/site-packages/anyio/streams/stapled.pyr zStapledByteStream.receive+s6�����q�=��C�D�D��(�(�0�0��;�;�;�;�s�/8�6�8c��VK�|jj|��d{���y7��w�N�r�send�r!�items  r#r'zStapledByteStream.send1� �������#�#�D�)�)�)���)�'�)c��TK�|jj��d{���y7��wr%�r�aclose�r!s r#�send_eofzStapledByteStream.send_eof4��������%�%�'�'�'���(�&�(c��K�|jj��d{���|jj��d{���y7�'7��wr%�rr.rr/s r#r.zStapledByteStream.aclose7�?�������%�%�'�'�'��!�!�(�(�*�*�*�	(��*��!�A�A�!A�A
�A�
Ac�^�i|jj�|jj�Sr%�r�extra_attributesrr/s r#r9z"StapledByteStream.extra_attributes;�4��
����/�/�
��!�!�2�2�
�	
�N)i)r"�int�return�bytes)r)r>r=�None�r=r?�r=zMapping[Any, Callable[[], Any]]��__name__�
__module__�__qualname__�__doc__�__annotations__r r'r0r.�propertyr9�r;r#rrs=��� ��%�%�<�*�(�+��
��
r;rc�X�eZdZUdZded<ded<dd�Zd
d�Zdd�Zdd	�Ze	dd
��Z
y)rab
    Combines two object streams into a single, bidirectional object stream.

    Extra attributes will be provided from both streams, with the receive stream
    providing the values in case of a conflict.

    :param ObjectSendStream send_stream: the sending object stream
    :param ObjectReceiveStream receive_stream: the receiving object stream
    zObjectSendStream[T_Item]rzObjectReceiveStream[T_Item]rc��RK�|jj��d{���S7��wr%)rr r/s r#r zStapledObjectStream.receiveRs!�����(�(�0�0�2�2�2�2�s�'�%�'c��VK�|jj|��d{���y7��wr%r&r(s  r#r'zStapledObjectStream.sendUr*r+c��TK�|jj��d{���y7��wr%r-r/s r#r0zStapledObjectStream.send_eofXr1r2c��K�|jj��d{���|jj��d{���y7�'7��wr%r4r/s r#r.zStapledObjectStream.aclose[r5r6c�^�i|jj�|jj�Sr%r8r/s r#r9z$StapledObjectStream.extra_attributes_r:r;N)r=r)r)rr=r?r@rArBrIr;r#rrCs=���*�)�/�/�3�*�(�+��
��
r;rc�T�eZdZUdZded<d	d�Z	d
					dd�Zd	d�Zedd��Z	y)
ra�
    Combines multiple listeners into one, serving connections from all of them at once.

    Any MultiListeners in the given collection of listeners will have their listeners
    moved into this one.

    Extra attributes are provided from each listener, with each successive listener
    overriding any conflicting attributes from the previous one.

    :param listeners: listeners to serve
    :type listeners: Sequence[Listener[T_Stream]]
    zSequence[Listener[T_Stream]]�	listenersc���g}|jD]N}t|t�r+|j|j�|jdd�=�>|j	|��P||_yr%)rQ�
isinstancer�extend�append)r!rQ�listeners   r#�
__post_init__zMultiListener.__post_init__xsX��.0�	����H��(�M�2�� � ��!3�!3�4��&�&�q�)�� � ��*�'�#��r;Nc���K�ddlm}|�4�d{���}|jD]}|j|j||��!ddd��d{���y7�C7�#1�d{���7swYyxYw�w)Nr)�create_task_group)�rYrQ�
start_soon�serve)r!�handler�
task_grouprY�tgrVs      r#r\zMultiListener.serve�sQ����	)�$�&�&�"� �N�N���
�
�h�n�n�g�z�B�+�'�&�&��&��&�&�&�sD�A1�A�A1�/A�A1�A�A1�A1�A.�"A%�#A.�*A1c��bK�|jD]}|j��d{����y7��wr%)rQr.)r!rVs  r#r.zMultiListener.aclose�s'�������H��/�/�#�#�#�'�#�s�#/�-�/c�b�i}|jD]}|j|j��|Sr%)rQ�updater9)r!�
attributesrVs   r#r9zMultiListener.extra_attributes�s1���
����H����h�7�7�8�'��r;r@r%)r]zCallable[[T_Stream], Any]r^zTaskGroup | Noner=r?rA)
rCrDrErFrGrWr\r.rHr9rIr;r#rrgsU���,�+�	#�RV�C�0�C�>N�C�	
�C�$����r;rN)�
__future__r�__all__�collections.abcrrr	�dataclassesr
�typingrrr
�abcrrrrrrrrrrrrrrIr;r#�<module>rjs���"���8�7�!�(�(�	�	�	�
��	���:����e��#
�
�#
��#
�L�e�� 
�'�&�/�<��+?� 
�� 
�F�e��.�G�H�%�x��'9�.��.r;