
    sj'                     2    d dl mZ  G d d      Z e       Zy)   )schedule_coroutinec                   ,    e Zd Zd Zd Zd Zd ZddZy)PublishManagerc                      g | _         d| _        y )N    )	protocolspublishCount)selfs    ;/DATA/.local/lib/python3.12/site-packages/wslink/publish.py__init__zPublishManager.__init__   s        c                 :    | j                   j                  |       y N)r   appendr
   protocols     r   registerProtocolzPublishManager.registerProtocol   s    h'r   c                 X    || j                   v r| j                   j                  |       y y r   )r   remover   s     r   unregisterProtocolz!PublishManager.unregisterProtocol   s%    t~~%NN!!(+ &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   Nc           
          | j                   D ]^  }d| d| j                   }|j                  j                          t	        d|j
                  |||||j                  j                         ` y )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   sj    HugQt'8'8&9:E$$--/++#(?&66>>		 'r   )NF)__name__
__module____qualname__r   r   r   r   r'   r   r   r   r   r      s    (,r   r   N) r   r   publishManagerr   r   r   <module>r-      s     ! !J  !r   