HEX
Server: Apache
System: Linux server2.voipitup.com.au 4.18.0-553.109.1.lve.el8.x86_64 #1 SMP Thu Mar 5 20:23:46 UTC 2026 x86_64
User: posscale (1027)
PHP: 8.2.30
Disabled: exec,passthru,shell_exec,system
Upload Files
File: //opt/saltstack/salt/lib/python3.10/site-packages/zmq/utils/__pycache__/monitor.cpython-310.pyc
o

�N�g��
@sdZddlZddlmZmZmZmZddlZddlZddl	m
Z
ddlmZGdd�de
�Z
deed	e
fd
d�Zdeeed	e
fd
d�Ze	dddded	ee
fdd��Ze	ddejeded	e
fdd��Z	ddejded	ee
ee
ffdd�ZddgZdS)zJModule holding utility and convenience functions for zmq event monitoring.�N)�	Awaitable�List�Union�overload)�	TypedDict)�_check_versionc@s&eZdZUeed<eed<eed<dS)�_MonitorMessage�event�value�endpointN)�__name__�
__module__�__qualname__�int�__annotations__�bytes�rr�E/opt/saltstack/salt/lib/python3.10/site-packages/zmq/utils/monitor.pyrs
r�msg�returncCs\t|�dkst|d�dkrtd|��t�d|d�\}}t�|�t�|�|dd�}|S)a�decode zmq_monitor event messages.

    Parameters
    ----------
    msg : list(bytes)
        zmq multipart message that has arrived on a monitor PAIR socket.

        First frame is::

            16 bit event id
            32 bit event value
            no padding

        Second frame is the endpoint as a bytestring

    Returns
    -------
    event : dict
        event description as dict with the keys `event`, `value`, and `endpoint`.
    �r�z Invalid event message format: %sz=hi�)r	r
r)�len�RuntimeError�struct�unpack�zmq�Event)rZevent_idr
r	rrr�parse_monitor_messages�r�
awaitable_msgc�s�|IdH}t|�S)zyLike parse_monitor_msg, but awaitable

    Given awaitable message, return awaitable for the parsed monitor message.
    N)r)r rrrr�_parse_monitor_msg_async5s�
r!�socketzzmq.asyncio.Socket�flagscC�dS�Nr�r"r#rrr�recv_monitor_messageB�r'cCr$r%rr&rrrr'Jr(cCs.tdd�|�|�}t|t�rt|�St|�S)u�Receive and decode the given raw message from the monitoring socket and return a dict.

    Requires libzmq ≥ 4.0

    The returned dict will have the following entries:
      event     : int, the event id as described in libzmq.zmq_socket_monitor
      value     : int, the event value associated with the event, see libzmq.zmq_socket_monitor
      endpoint  : string, the affected endpoint

    .. versionchanged:: 23.1
        Support for async sockets added.
        When called with a async socket,
        returns an awaitable for the monitor message.

    Parameters
    ----------
    socket : zmq PAIR socket
        The PAIR socket (created by other.get_monitor_socket()) on which to recv the message
    flags : bitfield (int)
        standard zmq recv flags

    Returns
    -------
    event : dict
        event description as dict with the keys `event`, `value`, and `endpoint`.
    )�rzlibzmq event API)rZrecv_multipart�
isinstancerr!r)r"r#rrrrr'Rs



)r)�__doc__r�typingrrrrrZzmq.asyncioZzmq._typingrZ	zmq.errorrrrrr!rr'ZSocket�__all__rrrr�<module>sR 
�
�
��������	���
�,