§
    &`ƒi½
  ã                   ó‚   — d dl Z d dlmZmZ d dlmZ d dlmZ d dlm	Z	  e	d¬¦  «         G d„ d	e¦  «        ¦   «         Z
dS )
é    N)ÚAnyÚOptional)ÚChannelContext)ÚChannelInterface)Ú	PublicAPIÚalpha)Ú	stabilityc                   ó˜   — e Zd ZdZ	 ddee         fd„Zdd„Zdd„Zd„ Z	defd	„Z
dd
edee         fd„Zddee         dedefd„Zdd„ZdS )ÚIntraProcessChannelaI  
    IntraProcessChannel is a channel for communication between two tasks in the same
    worker process. It writes data directly to the worker's _SerializationContext
    and reads data from the _SerializationContext to avoid the serialization
    overhead and the need for reading/writing from shared memory. Note that if the
    readers may mutate the data, users should deep copy the data themselves to avoid
    side effects.

    Args:
        num_readers: The number of readers that will read from this channel. Readers
            can be the same method of the same actor.
    NÚ_channel_idc                 ó~   — || _         || _        | j         €'t          t          j        ¦   «         ¦  «        | _         d S d S ©N)r   Ú_num_readersÚstrÚuuidÚuuid4)ÚselfÚnum_readersr   s      ú‚/home/jaya/work/projects/VOICE-AGENT/VIET/agent-env/lib/python3.11/site-packages/ray/experimental/channel/intra_process_channel.pyÚ__init__zIntraProcessChannel.__init__   sA   € ð 'ˆÔØ'ˆÔØÔÐ#Ý"¥4¤:¡<¤<Ñ0Ô0ˆDÔÐÐð $Ð#ó    Úreturnc                 ó   — d S r   © ©r   s    r   Úensure_registered_as_writerz/IntraProcessChannel.ensure_registered_as_writer$   ó   € Øˆr   c                 ó   — d S r   r   r   s    r   Úensure_registered_as_readerz/IntraProcessChannel.ensure_registered_as_reader'   r   r   c                 ó,   — t           | j        | j        ffS r   )r   r   r   r   s    r   Ú
__reduce__zIntraProcessChannel.__reduce__*   s    € Ý"ØÔØÔð%
ð 
ð 	
r   c                 ó   — d| j         › dS )NzIntraProcessChannel(channel_id=ú))r   r   s    r   Ú__str__zIntraProcessChannel.__str__0   s   € ØD°Ô1AÐDÐDÐDÐDr   ÚvalueÚtimeoutc                 ó    — |                       ¦   «          t          j        ¦   «         j        }|                     | j        || j        ¦  «         d S r   )r   r   Úget_currentÚserialization_contextÚset_datar   r   )r   r%   r&   Úctxs       r   ÚwritezIntraProcessChannel.write3   sI   € Ø×(Ò(Ñ*Ô*Ð*õ Ô(Ñ*Ô*Ô@ˆØŠTÔ% u¨dÔ.?Ñ@Ô@Ð@Ð@Ð@r   TÚdeserializec                 ó¦   — |                       ¦   «          |s
J d¦   «         ‚t          j        ¦   «         j        }|                     | j        ¦  «        S )Nz8Data passed from the actor to itself is never serialized)r   r   r(   r)   Úget_datar   )r   r&   r-   r+   s       r   ÚreadzIntraProcessChannel.read=   sN   € Ø×(Ò(Ñ*Ô*Ð*ØÐVÐVÐVÑVÔVˆ{åÔ(Ñ*Ô*Ô@ˆØ|Š|˜DÔ,Ñ-Ô-Ð-r   c                 ój   — t          j        ¦   «         j        }|                     | j        ¦  «         d S r   )r   r(   r)   Ú
reset_datar   )r   r+   s     r   ÚclosezIntraProcessChannel.closeD   s.   € ÝÔ(Ñ*Ô*Ô@ˆØŠtÔ'Ñ(Ô(Ð(Ð(Ð(r   r   )r   N)NT)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   r   r   r   r   r!   r$   r   Úfloatr,   Úboolr0   r3   r   r   r   r   r   	   s  € € € € € ðð ð  &*ð
1ð 
1ð ˜c”]ð
1ð 
1ð 
1ð 
1ðð ð ð ðð ð ð ð
ð 
ð 
ðE˜ð Eð Eð Eð EðAð A˜3ð A¨°%¬ð Að Að Að Að.ð .˜H UœOð .Àð .ÐQTð .ð .ð .ð .ð)ð )ð )ð )ð )ð )r   r   )r   Útypingr   r   Úray.experimental.channelr   Úray.experimental.channel.commonr   Úray.util.annotationsr   r   r   r   r   ú<module>r>      s«   ðØ €€€Ø  Ð  Ð  Ð  Ð  Ð  Ð  Ð  à 3Ð 3Ð 3Ð 3Ð 3Ð 3Ø <Ð <Ð <Ð <Ð <Ð <Ø *Ð *Ð *Ð *Ð *Ð *ð €WÐÑÔð<)ð <)ð <)ð <)ð <)Ð*ñ <)ô <)ñ Ôð<)ð <)ð <)r   