Format: application/x-python-code
⬇ Download File (7.3 KB)
   1  o
   2  
   3  ;'h��@s�ddlmZddlmZddlmZddlmZmZm	Z	m
   4  Z
   5  ddlmZddl
   6  mZdd	lmZdd
   7  lmZe	d�Ze	dd
   8  d�Ze	dd
   9  d�ZGdd�deeee�ZGdd�deeee�ZGdd�deeee�ZGdd�dee�ZGdd�dee�ZGdd�deeeeee�ZGdd�dee�ZGdd �d ee�ZGd!d"�d"ee�Ze
  10  eeefZ e
  11  eeefZ!e
  12  eeefZ"e
  13  eeefZ#e
  14  eeefZ$e
  15  eeefZ%Gd#d$�d$eeee�Z&d%S)&�)�annotations)�abstractmethod)�Callable)�Any�Generic�TypeVar�Union�)�EndOfStream)�TypedAttributeProvider�)�
  16  AsyncResource)�	TaskGroup�T_Item�T_coT)�	covariant�T_contra)�
  17  contravariantc@s2eZdZdZddd�Zd
  18  dd�Zed
  19  d	d
  20  ��ZdS)�UnreliableObjectReceiveStreama3
  21      An interface for receiving objects.
  22  
  23      This interface makes no guarantees that the received messages arrive in the order in
  24      which they were sent, or that no messages are missed.
  25  
  26      Asynchronously iterating over objects of this type will yield objects matching the
  27      given type parameter.
  28      �return�#UnreliableObjectReceiveStream[T_co]cC�|S�N���selfrr�HC:\Users\shubh\Videos\agent\nova\Lib\site-packages\anyio/abc/_streams.py�	__aiter__�z'UnreliableObjectReceiveStream.__aiter__rc��&�z|��IdHWStyt�wr��receiver
  29  �StopAsyncIterationrrrr�	__anext__!���z'UnreliableObjectReceiveStream.__anext__c���dS)aa
  30          Receive the next item.
  31  
  32          :raises ~anyio.ClosedResourceError: if the receive stream has been explicitly
  33              closed
  34          :raises ~anyio.EndOfStream: if this stream has been closed from the other end
  35          :raises ~anyio.BrokenResourceError: if this stream has been rendered unusable
  36              due to external causes
  37          Nrrrrrr!'�z%UnreliableObjectReceiveStream.receiveN)rr)rr��__name__�
  38  __module__�__qualname__�__doc__rr#rr!rrrrrs
  39  
  40  
  41  rc@�eZdZdZed	dd��ZdS)
  42  �UnreliableObjectSendStreamz�
  43      An interface for sending objects.
  44  
  45      This interface makes no guarantees that the messages sent will reach the
  46      recipient(s) in the same order in which they were sent, or at all.
  47      �itemrr�Nonec�r%)a4
  48          Send an item to the peer(s).
  49  
  50          :param item: the item to send
  51          :raises ~anyio.ClosedResourceError: if the send stream has been explicitly
  52              closed
  53          :raises ~anyio.BrokenResourceError: if this stream has been rendered unusable
  54              due to external causes
  55          Nr�rr.rrr�send>r&zUnreliableObjectSendStream.sendN)r.rrr/�r(r)r*r+rr1rrrrr-4sr-c@�eZdZdZdS)�UnreliableObjectStreamzs
  56      A bidirectional message stream which does not guarantee the order or reliability of
  57      message delivery.
  58      N�r(r)r*r+rrrrr4Ksr4c@r3)�ObjectReceiveStreamz�
  59      A receive message stream which guarantees that messages are received in the same
  60      order in which they were sent, and that no messages are missed.
  61      Nr5rrrrr6T�r6c@r3)�ObjectSendStreamz�
  62      A send message stream which guarantees that messages are delivered in the same order
  63      in which they were sent, without missing any messages in the middle.
  64      Nr5rrrrr8[r7r8c@�eZdZdZeddd��ZdS)�ObjectStreamzl
  65      A bidirectional message stream which guarantees the order and reliability of message
  66      delivery.
  67      rr/c�r%�z�
  68          Send an end-of-file indication to the peer.
  69  
  70          You should not try to send any further data to this stream after calling this
  71          method. This method is idempotent (does nothing on successive calls).
  72          Nrrrrr�send_eoflr&zObjectStream.send_eofN�rr/�r(r)r*r+rr<rrrrr:bsr:c@s4eZdZdZddd�Zddd�Zedddd��Zd
  73  S)�ByteReceiveStreamz�
  74      An interface for receiving bytes from a single peer.
  75  
  76      Iterating this byte stream will yield a byte string of arbitrary length, but no more
  77      than 65536 bytes.
  78      rcCrrrrrrrr~rzByteReceiveStream.__aiter__�bytesc�rrr rrrrr#�r$zByteReceiveStream.__anext__��	max_bytes�intc�r%)a�
  79          Receive at most ``max_bytes`` bytes from the peer.
  80  
  81          .. note:: Implementers of this interface should not return an empty
  82              :class:`bytes` object, and users should ignore them.
  83  
  84          :param max_bytes: maximum number of bytes to receive
  85          :return: the received bytes
  86          :raises ~anyio.EndOfStream: if this stream has been closed from the other end
  87          Nr)rrBrrrr!�r&zByteReceiveStream.receiveN)rr?)rr@)rA)rBrCrr@r'rrrrr?vs
  88  
  89  r?c@r,)
  90  �ByteSendStreamz0An interface for sending bytes to a single peer.r.r@rr/c�r%)z[
  91          Send the given bytes to the peer.
  92  
  93          :param item: the bytes to send
  94          Nrr0rrrr1�r&zByteSendStream.sendN)r.r@rr/r2rrrrrD��rDc@r9)�
  95  ByteStreamzA bidirectional byte stream.rr/c�r%r;rrrrrr<�r&zByteStream.send_eofNr=r>rrrrrF�rErFc@s"eZdZdZe	ddd	d
  96  ��ZdS)
  97  �ListenerzBAn interface for objects that let you accept incoming connections.N�handler�Callable[[T_co], Any]�
  98  task_group�TaskGroup | Nonerr/c�r%)af
  99          Accept incoming connections as they come in and start tasks to handle them.
 100  
 101          :param handler: a callable that will be used to handle each accepted connection
 102          :param task_group: the task group that will be used to start tasks for handling
 103              each accepted connection (if omitted, an ad-hoc task group will be created)
 104          Nr)rrHrJrrr�serve�r&zListener.server)rHrIrJrKrr/)r(r)r*r+rrLrrrrrG�s
 105  �rGN)'�
 106  __future__r�abcr�collections.abcr�typingrrrrZ_core._exceptionsr
 107  Z_core._typedattrrZ
 108  _resourcesr
 109  �_tasksrrrrrr-r4r6r8r:r?rDrFr@ZAnyUnreliableByteReceiveStreamZAnyUnreliableByteSendStreamZAnyUnreliableByteStreamZAnyByteReceiveStreamZAnyByteSendStreamZ
 110  AnyByteStreamrGrrrr�<module>sN
 111  
 112  �
 113  #
 114  �
 115  �	
 116  �
 117  �