File: //lib64/python3.6/site-packages/zmq/eventloop/__pycache__/_deprecated.cpython-36.opt-1.pyc
3
VS�_� � @ s d Z ddlmZmZmZ ddlZddlZddlZddlm Z m
Z
mZmZm
Z
mZ yddlZejZW n eefk
r~ f ZY nX ddlmZmZ ddlmZ G dd � d e�ZG d
d� de�ZG dd
� d
e�Zde ko�dk n r�ddd�Zee_eZdd� Z dS )uX tornado IOLoop API with zmq compatibility
If you have tornado ≥ 3.0, this is a subclass of tornado's IOLoop,
otherwise we ship a minimal subset of tornado in zmq.eventloop.minitornado.
The minimal shipped version of tornado's IOLoop does not include
support for concurrent futures - this will only be available if you
have tornado ≥ 3.0.
� )�absolute_import�division�with_statementN)�Poller�POLLIN�POLLOUT�POLLERR�ZMQError�ETERM� )�
PollIOLoop�PeriodicCallback)�gen_logc s2 e Zd ZdZd � fdd� Zdd� Zdd� Z� ZS )
�DelayedCallbackz�Schedules the given callback to be called once.
The callback is called once, after callback_time milliseconds.
`start` must be called after the DelayedCallback is created.
The timeout is calculated from when `start` is called.
Nc s. t jdt� t|d�}tt| �j|||� d S )NzDDelayedCallback is deprecated.
Use loop.add_timeout instead.g����MbP?)�warnings�warn�DeprecationWarning�max�superr �__init__)�self�callback�
callback_time�io_loop)� __class__� �#/usr/lib64/python3.6/_deprecated.pyr . s
zDelayedCallback.__init__c C s6 d| _ d| _tj� | jd | _| jj| j| j� dS )zStarts the timer.Tg @�@N)�_runningZ _firstrun�timer Z
_next_timeoutr Zadd_timeout�_run)r r r r �start5 s zDelayedCallback.startc C sD | j s
d S d| _ y| j� W n" tk
r> tjddd� Y nX d S )NFzError in delayed callbackT)�exc_info)r r � Exceptionr �error)r r r r r <