Файловый менеджер - Редактировать - /opt/imh-python/lib/python3.9/site-packages/zmq/eventloop/__pycache__/zmqstream.cpython-39.pyc
Ðазад
a a�h)L � @ s& d Z ddlmZ ddlZddlZddlZddlmZ zddlZ W n e yZ ddl Z Y n0 ddlmZm Z zddlmZ W n2 e y� dejv r�ddlmZ nd d � ZY n0 zddlmZ W n e y� ddlmZ Y n0 ddlmZ ze W n e�y d d� ZY n0 G dd� de�ZdS )z�A utility class to send to and recv from a non-blocking socket, using tornado. .. seealso:: - :mod:`zmq.asyncio` - :mod:`zmq.eventloop.future` � )�with_statementN)�jsonapi� )�IOLoop�gen_log)�wrapzzmq.eventloop.minitornadoc C s | S �N� )�callbackr r ��/root/rpmbuild/BUILDROOT/imh-python39-modules-3.9.7-92.el8.x86_64/opt/imh-python/lib/python3.9/site-packages/zmq/eventloop/zmqstream.py�stack_context_wrap0 s r )�Queue)� basestringc C s t | d�S )N�__call__)�hasattr)�objr r r �<lambda>= � r c @ sX e Zd ZdZdZdZdZdZdZdZ dZ dZdZdZ dZdFdd�Zdd� Zd d � Zdd� Zd d� ZdGdd�ZdHdd�Zdd� Zdd� ZdIdd�ZdJdd�ZdKdd�ZeZdLdd �ZdMd"d#�Zd$d%� Zej ej!B dfd&d'�Z"d(d)� Z#dNd*d+�Z$d,d-� Z%d.d/� Z&d0d1� Z'd2d3� Z(d4d5� Z)d6d7� Z*d8d9� Z+d:d;� Z,d<d=� Z-d>d?� Z.d@dA� Z/dBdC� Z0dDdE� Z1dS )O� ZMQStreama> A utility class to register callbacks when a zmq socket sends and receives For use with zmq.eventloop.ioloop There are three main methods Methods: * **on_recv(callback, copy=True):** register a callback to be run every time the socket has something to receive * **on_send(callback):** register a callback to be run every time you call send * **send(self, msg, flags=0, copy=False, callback=None):** perform a send that will trigger the callback if callback is passed, on_send is also called. There are also send_multipart(), send_json(), send_pyobj() Three other methods for deactivating the callbacks: * **stop_on_recv():** turn off the recv callback * **stop_on_send():** turn off the send callback which simply call ``on_<evt>(None)``. The entire socket interface, excluding direct recv methods, is also provided, primarily through direct-linking the methods. e.g. >>> stream.bind is stream.socket.bind True Nr Fc C s� || _ |pt�� | _t�� | _| j j| _t � | _ d | _d | _d | _ d| _d| _d| _| �� | j j| _| j j| _| j j| _| j j| _| j j| _| j j| _| j j| _| j j| _| j j| _d S )NFr )�socketr �current�io_loop�zmqZPoller�pollerZFD�_fdr �_send_queue�_recv_callback�_send_callback�_close_callback� _recv_copy�_flushed�_state�_init_io_state�bindZbind_to_random_port�connect� setsockopt� getsockoptZsetsockopt_stringZgetsockopt_stringZsetsockopt_unicodeZgetsockopt_unicode)�selfr r r r r �__init__q s* zZMQStream.__init__c C s | � d�S )z)Disable callback and automatic receiving.N)�on_recv�r'