]L iBUddlmZddlZddlmcmZddlZddl m Z m Z ddl m Z ddlmZmZmZmZddlmZddlmZd d lmZd d lmZej6d k\rdd lmZndd lmZedZeddZeddZ GddeeeeZ!Gddee eeZ"Gdde!ee"eZ#Gdde!eZ$Gdde"e Z%Gdde$ee%ee#eZ&Gd d!eeZ'Gd"d#eeZ(Gd$d%e'e(Z)ee!e*e'fZ+d&e,d'<ee"e*e(fZ-d&e,d(<ee#e*e)fZ.d&e,d)<ee$e*e'fZ/d&e,d*<ee%e*e(fZ0d&e,d+<ee&e*e)fZ1d&e,d,<Gd-d.eeeeZ2Gd/d0eee 1Z3Gd2d3e 1Z4ee3e*e4fZ5d&e,d4<y)5) annotationsN)ABCMetaabstractmethod)Callable)AnyGenericTypeVarUnion) EndOfStream)TypedAttributeProvider) AsyncResource) TaskGroup) ) TypeAliasT_ItemT_coT) covariantT_contra) contravariantc2eZdZdZddZddZeddZy)UnreliableObjectReceiveStreama3 An interface for receiving objects. This interface makes no guarantees that the received messages arrive in the order in which they were sent, or that no messages are missed. Asynchronously iterating over objects of this type will yield objects matching the given type parameter. c|SNselfs X/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/anyio/abc/_streams.py __aiter__z'UnreliableObjectReceiveStream.__aiter__$ chK |jd{S7#t$rtdwxYwwrreceiver StopAsyncIterationrs r __anext__z'UnreliableObjectReceiveStream.__anext__'3 /' '' /$$ . / 22/2c Kyw)aa Receive the next item. :raises ~anyio.ClosedResourceError: if the receive stream has been explicitly closed :raises ~anyio.EndOfStream: if this stream has been closed from the other end :raises ~anyio.BrokenResourceError: if this stream has been rendered unusable due to external causes Nrrs r r&z%UnreliableObjectReceiveStream.receive-N)returnz#UnreliableObjectReceiveStream[T_co])r.r__name__ __module__ __qualname____doc__r!r(rr&rr#r rrs%/     r#rc"eZdZdZeddZy)UnreliableObjectSendStreamz An interface for sending objects. This interface makes no guarantees that the messages sent will reach the recipient(s) in the same order in which they were sent, or at all. c Kyw)a4 Send an item to the peer(s). :param item: the item to send :raises ~anyio.ClosedResourceError: if the send stream has been explicitly closed :raises ~anyio.BrokenResourceError: if this stream has been rendered unusable due to external causes Nrritems r sendzUnreliableObjectSendStream.sendDr,r-N)r8rr.Noner0r1r2r3rr9rr#r r5r5:s    r#r5ceZdZdZy)UnreliableObjectStreamzs A bidirectional message stream which does not guarantee the order or reliability of message delivery. Nr0r1r2r3rr#r r=r=Qsr#r=ceZdZdZy)ObjectReceiveStreamz A receive message stream which guarantees that messages are received in the same order in which they were sent, and that no messages are missed. Nr>rr#r r@r@Zr#r@ceZdZdZy)ObjectSendStreamz A send message stream which guarantees that messages are delivered in the same order in which they were sent, without missing any messages in the middle. Nr>rr#r rCrCarAr#rCc"eZdZdZeddZy) ObjectStreamzl A bidirectional message stream which guarantees the order and reliability of message delivery. c Kywz Send an end-of-file indication to the peer. You should not try to send any further data to this stream after calling this method. This method is idempotent (does nothing on successive calls). Nrrs r send_eofzObjectStream.send_eofrr,r-Nr.r:r0r1r2r3rrHrr#r rErEhs    r#rEc4eZdZdZddZddZedd dZy) ByteReceiveStreamz An interface for receiving bytes from a single peer. Iterating this byte stream will yield a byte string of arbitrary length, but no more than 65536 bytes. c|Srrrs r r!zByteReceiveStream.__aiter__r"r#chK |jd{S7#t$rtdwxYwwrr%rs r r(zByteReceiveStream.__anext__r)r*c Kyw)a Receive at most ``max_bytes`` bytes from the peer. .. note:: Implementers of this interface should not return an empty :class:`bytes` object, and users should ignore them. :param max_bytes: maximum number of bytes to receive :return: the received bytes :raises ~anyio.EndOfStream: if this stream has been closed from the other end Nr)r max_bytess r r&zByteReceiveStream.receiver,r-N)r.rL)r.bytes)i)rPintr.rQr/rr#r rLrL|s%/     r#rLc"eZdZdZeddZy)ByteSendStreamz0An interface for sending bytes to a single peer.c Kyw)z[ Send the given bytes to the peer. :param item: the bytes to send Nrr7s r r9zByteSendStream.sendr,r-N)r8rQr.r:r;rr#r rTrTs:  r#rTc"eZdZdZeddZy) ByteStreamzA bidirectional byte stream.c KywrGrrs r rHzByteStream.send_eofr,r-NrIrJrr#r rWrWs&  r#rWrAnyUnreliableByteReceiveStreamAnyUnreliableByteSendStreamAnyUnreliableByteStreamAnyByteReceiveStreamAnyByteSendStream AnyByteStreamc0eZdZdZe d ddZy)ListenerzBAn interface for objects that let you accept incoming connections.Nc Kyw)af Accept incoming connections as they come in and start tasks to handle them. :param handler: a callable that will be used to handle each accepted connection :param task_group: the task group that will be used to start tasks for handling each accepted connection (if omitted, an ad-hoc task group will be created) Nr)rhandler task_groups r servezListener.server,r-r)rbzCallable[[T_co], Any]rczTaskGroup | Noner.r:)r0r1r2r3rrdrr#r r`r`s2LMQ  ,  :J      r#r`ceZdZeddZy)ObjectStreamConnectablec Kyw)z Connect to the remote endpoint. :return: an object stream connected to the remote end :raises ConnectionFailed: if the connection fails Nrrs r connectzObjectStreamConnectable.connectr,r-N)r.zObjectStream[T_co]r0r1r2rrhrr#r rfrf  r#rf) metaclassceZdZeddZy)ByteStreamConnectablec Kyw)z Connect to the remote endpoint. :return: a bytestream connected to the remote end :raises ConnectionFailed: if the connection fails Nrrs r rhzByteStreamConnectable.connectr,r-N)r.rWrirr#r rmrmrjr#rmAnyByteStreamConnectable)6 __future__rbuiltins @py_builtins_pytest.assertion.rewrite assertionrewrite @pytest_arsysabcrrcollections.abcrtypingrrr r _core._exceptionsr _core._typedattrr _resourcesr_tasksr version_infortyping_extensionsrrrrr5r=r@rCrErLrTrWrQrY__annotations__rZr[r\r]r^r`rfrmrorr#r rs" '$//+5%w +  v& :T 2   DM="8  F  H}&< .!&)+Ef+M7=1(; V6" ( '= >  ]$:    "N  -2!%(*;;- */u%~5*Y&++A%+H*+T%UU"'(;E(BDU(U"ViV$%5e%