File: //usr/lib64/python3.6/site-packages/zmq/auth/__pycache__/asyncio.cpython-36.pyc
3
VS�_M � @ sF d Z ddlZddlZddlmZ ddlmZ G dd� de�ZdgZdS )zOZAP Authenticator integrated with the asyncio IO loop.
.. versionadded:: 15.2
� N)�Poller� )�
Authenticatorc sB e Zd ZdZd� fdd� Zdd� Z� fdd�Z� fd d
�Z� ZS )�AsyncioAuthenticatorz1ZAP authentication for use in the asyncio IO loopNc s* t � j|� |ptj� | _d | _d | _d S )N)�super�__init__�asyncioZget_event_loop�loop�_AsyncioAuthenticator__poller�_AsyncioAuthenticator__task)�self�contextr )� __class__� �/usr/lib64/python3.6/asyncio.pyr s zAsyncioAuthenticator.__init__c � sB x<| j j� I d H }| jt|�kr| jj� I d H }| j|� qW d S )N)r
Zpoll�
zap_socket�dictZrecv_multipartZhandle_zap_message)r Zevents�msgr r r Z__handle_zap s
z!AsyncioAuthenticator.__handle_zapc s8 t � j� t� | _| jj| jtj� tj | j
� �| _dS )zStart ZAP authenticationN)r �startr r
�registerr �zmqZPOLLINr Z
ensure_future�!_AsyncioAuthenticator__handle_zapr )r )r r r r s
zAsyncioAuthenticator.startc s8 | j r| j j� | jr*| jj| j� d| _t� j� dS )zStop ZAP authenticationN)r Zcancelr
Z
unregisterr r �stop)r )r r r r '