
    )j'                     @    d dl mZ  G d d          Z e            ZdS )   )schedule_coroutinec                   .    e Zd Zd Zd Zd Zd ZddZdS )	PublishManagerc                 "    g | _         d| _        d S )N    )	protocolspublishCount)selfs    H/DATA/AppData/hermes/venv/lib/python3.11/site-packages/wslink/publish.py__init__zPublishManager.__init__   s        c                 :    | j                             |           d S N)r   appendr
   protocols     r   registerProtocolzPublishManager.registerProtocol   s    h'''''r   c                 P    || j         v r| j                             |           d S d S r   )r   remover   s     r   unregisterProtocolz!PublishManager.unregisterProtocol   s3    t~%%N!!(+++++ &%r   c                     |S )zDeprecated method, keeping it to avoid breaking compatibility
        Now that we use msgpack to pack/unpack messages,
        We can have binary data directly in the object itself,
        without needing to transfer it separately from the rest. )r
   payloads     r   addAttachmentzPublishManager.addAttachment   s	    
 r   NFc           
          | j         D ]M}d| d| j         }|j                                         t	          d|j        |||||j        j                   Nd S )Nzpublish::r   )	client_idskip_last_active_clientdone_callback)r   r	   network_monitoron_enterr   sendWrappedMessageon_exit)r
   topicdatar   r   r   rpcids          r   publishzPublishManager.publish   s     	 	H:u::t'8::E$--///+#(?&6>	 	 	 	 			 	r   )NF)__name__
__module____qualname__r   r   r   r   r'   r   r   r   r   r      sd          ( ( (, , ,       r   r   N) r   r   publishManagerr   r   r   <module>r-      sS               ! ! ! ! ! ! ! !J  !!r   