+
    Di)                       ^ RI Ht Rt^ RIt^ RIHtHt ^ RIHtH	t	 ^ RI
Ht ^ R	IHtHtHt ^R
IHtHtHtHt ^RIHtHt ^RIHtHtHt ^RIHt ]! R4      t]! RRR7      t]! RRR7      t  ! R R]4      t!]! RR7       ! R R]],          4      4       t"]! RR7       ! R R]],          4      4       t#]! RR7       ! R R]],          ]],          4      4       t$]! RR7       ! R R]] ,          ]] ,          4      4       t%R# )    )annotationsMemoryObjectReceiveStreamMemoryObjectSendStreamMemoryObjectStreamStatisticsN)OrderedDictdeque)	dataclassfield)TracebackType)Generic
NamedTupleTypeVar)BrokenResourceErrorClosedResourceErrorEndOfStream
WouldBlock)TaskInfoget_current_task)EventObjectReceiveStreamObjectSendStream)
checkpointT_ItemT_coT)	covariantT_contra)contravariantc                  T    ] tR t^t$ R]R&   R]R&   R]R&   R]R&   R]R&   R]R&   R	tR
# )r   intcurrent_buffer_usedfloatmax_buffer_sizeopen_send_streamsopen_receive_streamstasks_waiting_sendtasks_waiting_receive N)__name__
__module____qualname____firstlineno____annotations____static_attributes__r'       r/Users/tonyclaw/.openclaw/workspace/services/omi-webhook/venv/lib/python3.14/site-packages/anyio/streams/memory.pyr   r      s&    r.   F)eqc                  ^    ] tR t^*t$ ]! R]R7      tR]R&   ]! RR7      tR]R&   R R	 lt	R
t
R# )_MemoryObjectItemReceiverFinitdefault_factoryr   	task_info)r4   r   itemc                   V ^8  d   QhRR/# )   returnstrr'   )formats   "r/   __annotate__&_MemoryObjectItemReceiver.__annotate__/   s     W W# Wr.   c                	p    \        V R R4      pV P                  P                   RV P                   RV: R2# )r7   Nz(task_info=z, item=))getattr	__class__r(   r6   )selfr7   s   & r/   __repr__"_MemoryObjectItemReceiver.__repr__/   s<     tVT*..))*+dnn5EWTHTUVVr.   r'   N)r(   r)   r*   r+   r
   r   r6   r,   r7   rD   r-   r'   r.   r/   r2   r2   *   s/    U<LMIxMe$D&$W Wr.   r2   c                      ] tR t^6t$ ]! 4       tR]R&   ]! R]R7      tR]R&   ]! R^ R7      t	R]R	&   ]! R^ R7      t
R]R
&   ]! R]R7      tR]R&   ]! R]R7      tR]R&   R R ltRtR# )_MemoryObjectStreamStater!   r"   Fr3   zdeque[T_Item]bufferr4   defaultr   open_send_channelsopen_receive_channelsz5OrderedDict[Event, _MemoryObjectItemReceiver[T_Item]]waiting_receiverszOrderedDict[Event, T_Item]waiting_sendersc                   V ^8  d   QhRR/# r9   r:   r   r'   )r<   s   "r/   r=   %_MemoryObjectStreamState.__annotate__C   s     
 
8 
r.   c           
     	    \        \        V P                  4      V P                  V P                  V P
                  \        V P                  4      \        V P                  4      4      # N)r   lenrH   r"   rK   rL   rN   rM   rC   s   &r/   
statistics#_MemoryObjectStreamState.statisticsC   sR    +  ##&&$$%&&'
 	
r.   r'   N)r(   r)   r*   r+   r
   r"   r,   r   rH   rK   rL   r   rM   rN   rV   r-   r'   r.   r/   rG   rG   6   s    "WOU$!ueDFMD#::!&E1!=3=OTKPL  38K3O/ 
 
r.   rG   c                      ] tR t^Nt$ R]R&   ]! RRR7      tR]R&   R R ltR	 R
 ltR R lt	R R lt
R R ltR R ltR R ltR R ltR R ltR R ltRtR# )r   z_MemoryObjectStreamState[T_co]_stateFrI   bool_closedc                   V ^8  d   QhRR/# r9   r:   Noner'   )r<   s   "r/   r=   &MemoryObjectReceiveStream.__annotate__S   s     / /t /r.   c                	L    V P                   ;P                  ^,          un        R#    N)rY   rL   rU   s   &r/   __post_init__'MemoryObjectReceiveStream.__post_init__S   s    ))Q.)r.   c                   V ^8  d   QhRR/# r9   r:   r   r'   )r<   s   "r/   r=   r_   V   s       r.   c                   V P                   '       d   \        hV P                  P                  '       d^   V P                  P                  P	                  RR7      w  rV P                  P
                  P                  V4       VP                  4        V P                  P
                  '       d%   V P                  P
                  P                  4       # V P                  P                  '       g   \        h\        h)ak  
Receive the next item if it can be done without waiting.

:return: the received item
:raises ~anyio.ClosedResourceError: if this send stream has been closed
:raises ~anyio.EndOfStream: if the buffer is empty and this stream has been
    closed from the sending end
:raises ~anyio.WouldBlock: if there are no items in the buffer and no tasks
    waiting to send

Flast)r[   r   rY   rN   popitemrH   appendsetpopleftrK   r   r   )rC   
send_eventr7   s   &  r/   receive_nowait(MemoryObjectReceiveStream.receive_nowaitV   s     <<<%%;;&&&#{{::BBBNJKK%%d+NN;;;;%%--/////r.   c                   V ^8  d   QhRR/# rf   r'   )r<   s   "r/   r=   r_   r   s     , ,t ,r.   c                	  "   \        4       G R j  xL
   V P                  4       #  L  \         d    \        4       p\        \
        ,          ! 4       pY P                  P                  T&    TP                  4       G R j  xL 
  T P                  P                  P                  TR 4       M+  T P                  P                  P                  TR 4       i ; i TP                  u #   \         d	    \        R hi ; ii ; i5irS   )r   ro   r   r   r2   r   rY   rM   waitpopr7   AttributeErrorr   )rC   receive_eventreceivers   &  r/   receive!MemoryObjectReceiveStream.receiver   s     l	,&&(( 	  	,!GM068H;CKK))-8G#((***--11-F--11-F,}}$! ,!t+,	,se   D &D ( D AC=,B,?B B,'C=,(CC=C&#C=$D &C99C==D c                   V ^8  d   QhRR/# r9   r:   zMemoryObjectReceiveStream[T_co]r'   )r<   s   "r/   r=   r_      s     = =6 =r.   c                ^    V P                   '       d   \        h\        V P                  R7      # )z
Create a clone of this receive stream.

Each clone can be closed separately. Only when all clones have been closed will
the receiving end of the memory stream be considered closed by the sending ends.

:return: the cloned stream

rY   )r[   r   r   rY   rU   s   &r/   cloneMemoryObjectReceiveStream.clone   s"     <<<%%(<<r.   c                   V ^8  d   QhRR/# r]   r'   )r<   s   "r/   r=   r_      s        t  r.   c                H   V P                   '       g   RV n         V P                  ;P                  ^,          un        V P                  P                  ^ 8X  dI   \        V P                  P                  P                  4       4      pV F  pVP                  4        K  	  R# R# R# z
Close the stream.

This works the exact same way as :meth:`aclose`, but is provided as a special
case for the benefit of synchronous callbacks.

TN)r[   rY   rL   listrN   keysrl   )rC   send_eventsevents   &  r/   closeMemoryObjectReceiveStream.close   su     |||DLKK--2-{{00A5"4;;#>#>#C#C#EF(EIIK ) 6 r.   c                   V ^8  d   QhRR/# r]   r'   )r<   s   "r/   r=   r_            d r.   c                	.   "   V P                  4        R # 5irS   r   rU   s   &r/   aclose MemoryObjectReceiveStream.aclose        

   c                   V ^8  d   QhRR/# rP   r'   )r<   s   "r/   r=   r_           ( (8 (r.   c                6    V P                   P                  4       # zR
Return statistics about the current state of this stream.

.. versionadded:: 3.0
rY   rV   rU   s   &r/   rV   $MemoryObjectReceiveStream.statistics        {{%%''r.   c                   V ^8  d   QhRR/# r{   r'   )r<   s   "r/   r=   r_      s      : r.   c                	    V # rS   r'   rU   s   &r/   	__enter__#MemoryObjectReceiveStream.__enter__       r.   c               (    V ^8  d   QhRRRRRRRR/# 	r9   exc_typeztype[BaseException] | Noneexc_valzBaseException | Noneexc_tbzTracebackType | Noner:   r^   r'   )r<   s   "r/   r=   r_      2      , & %	
 
r.   c                	&    V P                  4        R # rS   r   rC   r   r   r   s   &&&&r/   __exit__"MemoryObjectReceiveStream.__exit__        	

r.   c                   V ^8  d   QhRR/# r]   r'   )r<   s   "r/   r=   r_             r.   c                	    V P                   '       gF   \        P                  ! R V P                  P                   R\        V 4      R R2\        ^V R7       R# R# z
Unclosed <z at x>)
stacklevelsourceNr[   warningswarnrB   r(   idResourceWarningrU   s   &r/   __del__!MemoryObjectReceiveStream.__del__   H    |||MMT^^445T"T(1QG	 r.   r[   N)r(   r)   r*   r+   r,   r
   r[   rc   ro   rx   r~   r   r   rV   r   r   r   r-   r'   r.   r/   r   r   N   sP    **ue4GT4/8,(=  ( r.   c                      ] tR t^t$ R]R&   ]! RRR7      tR]R&   R R ltR	 R
 ltR R lt	R R lt
R R ltR R ltR R ltR R ltR R ltR R ltRtR# )r   z"_MemoryObjectStreamState[T_contra]rY   FrI   rZ   r[   c                   V ^8  d   QhRR/# r]   r'   )r<   s   "r/   r=   #MemoryObjectSendStream.__annotate__   s     , ,t ,r.   c                	L    V P                   ;P                  ^,          un        R# ra   )rY   rK   rU   s   &r/   rc   $MemoryObjectSendStream.__post_init__   s    &&!+&r.   c                    V ^8  d   QhRRRR/# r9   r7   r   r:   r^   r'   )r<   s   "r/   r=   r      s       T r.   c                <   V P                   '       d   \        hV P                  P                  '       g   \        hV P                  P
                  '       dc   V P                  P
                  P                  RR7      w  r#VP                  P                  4       '       d   Kf  Wn	        VP                  4        R# \        V P                  P                  4      V P                  P                  8  d(   V P                  P                  P                  V4       R# \        h)aa  
Send an item immediately if it can be done without waiting.

:param item: the item to send
:raises ~anyio.ClosedResourceError: if this send stream has been closed
:raises ~anyio.BrokenResourceError: if the stream has been closed from the
    receiving end
:raises ~anyio.WouldBlock: if the buffer is full and there are no tasks waiting
    to receive

Frh   N)r[   r   rY   rL   r   rM   rj   r6   has_pending_cancellationr7   rl   rT   rH   r"   rk   r   )rC   r7   rv   rw   s   &&  r/   send_nowait"MemoryObjectSendStream.send_nowait   s     <<<%%{{000%%kk+++&*kk&C&C&K&KQV&K&W#M%%>>@@ $!!#t{{!!"T[[%@%@@KK%%d+r.   c                    V ^8  d   QhRRRR/# r   r'   )r<   s   "r/   r=   r      s     4 4x 4D 4r.   c                  "   \        4       G Rj  xL
   V P                  V4       R#  L  \         d    \        4       pYP                  P
                  T&    TP                  4       G Rj  xL 
  M6  \         d)    T P                  P
                  P                  TR4       h i ; iY P                  P
                  9   d   T P                  P
                  T \        Rh R# i ; i5i)ae  
Send an item to the stream.

If the buffer is full, this method blocks until there is again room in the
buffer or the item can be sent directly to a receiver.

:param item: the item to send
:raises ~anyio.ClosedResourceError: if this send stream has been closed
:raises ~anyio.BrokenResourceError: if the stream has been closed from the
    receiving end

N)
r   r   r   r   rY   rN   rs   BaseExceptionrt   r   )rC   r7   rn   s   && r/   sendMemoryObjectSendStream.send   s      l	4T" 	  	4J6:KK''
3 oo'''  ++//
DA [[888KK//
;)t3 9	4sR   C()C(+ C(-C%A3,A/-A32C%33B&&;C%!C($C%%C(c                   V ^8  d   QhRR/# r9   r:   z MemoryObjectSendStream[T_contra]r'   )r<   s   "r/   r=   r     s     : :7 :r.   c                ^    V P                   '       d   \        h\        V P                  R7      # )z
Create a clone of this send stream.

Each clone can be closed separately. Only when all clones have been closed will
the sending end of the memory stream be considered closed by the receiving ends.

:return: the cloned stream

r}   )r[   r   r   rY   rU   s   &r/   r~   MemoryObjectSendStream.clone  s"     <<<%%%T[[99r.   c                   V ^8  d   QhRR/# r]   r'   )r<   s   "r/   r=   r     s        t  r.   c                   V P                   '       g   RV n         V P                  ;P                  ^,          un        V P                  P                  ^ 8X  dm   \        V P                  P                  P                  4       4      pV P                  P                  P                  4        V F  pVP                  4        K  	  R# R# R# r   )r[   rY   rK   r   rM   r   clearrl   )rC   receive_eventsr   s   &  r/   r   MemoryObjectSendStream.close  s     |||DLKK**a/*{{--2!%dkk&C&C&H&H&J!K--335+EIIK , 3 r.   c                   V ^8  d   QhRR/# r]   r'   )r<   s   "r/   r=   r   (  r   r.   c                	.   "   V P                  4        R # 5irS   r   rU   s   &r/   r   MemoryObjectSendStream.aclose(  r   r   c                   V ^8  d   QhRR/# rP   r'   )r<   s   "r/   r=   r   +  r   r.   c                6    V P                   P                  4       # r   r   rU   s   &r/   rV   !MemoryObjectSendStream.statistics+  r   r.   c                   V ^8  d   QhRR/# r   r'   )r<   s   "r/   r=   r   3  s      ; r.   c                	    V # rS   r'   rU   s   &r/   r    MemoryObjectSendStream.__enter__3  r   r.   c               (    V ^8  d   QhRRRRRRRR/# r   r'   )r<   s   "r/   r=   r   6  r   r.   c                	&    V P                  4        R # rS   r   r   s   &&&&r/   r   MemoryObjectSendStream.__exit__6  r   r.   c                   V ^8  d   QhRR/# r]   r'   )r<   s   "r/   r=   r   >  r   r.   c                	    V P                   '       gF   \        P                  ! R V P                  P                   R\        V 4      R R2\        ^V R7       R# R# r   r   rU   s   &r/   r   MemoryObjectSendStream.__del__>  r   r.   r   N)r(   r)   r*   r+   r,   r
   r[   rc   r   r   r~   r   r   rV   r   r   r   r-   r'   r.   r/   r   r      sP    ..ue4GT4,:4<: "( r.   )r   r   r   )&
__future__r   __all__r   collectionsr   r   dataclassesr	   r
   typesr   typingr   r   r    r   r   r   r   _core._testingr   r   abcr   r   r   lowlevelr   r   r   r   r   r2   rG   r   r   r'   r.   r/   <module>r      s   "  * (  / /  8 > > !		v&:T2	: 	 eW W W e
wv 
 
. es/B4/H s sl eWX.0@0J  r.   