File manager - Edit - /opt/saltstack/salt/lib/python3.10/site-packages/salt/ext/tornado/platform/__pycache__/asyncio.cpython-310.pyc
Back
o ;jX � @ s� d Z ddlmZmZmZ ddlZddlZddlm Z ddl mZ ddlm Z zddlZW n" eyN Z zzddlZW n eyC e�w W Y dZ[ndZ[ww G dd� de�ZG d d � d e�ZG dd� de�Zd d� Zdd� Zee d�r}e �eje� dS dS )a Bridges between the `asyncio` module and Tornado IOLoop. .. versionadded:: 3.2 This module integrates Tornado with the ``asyncio`` module introduced in Python 3.4 (and available `as a separate download <https://pypi.python.org/pypi/asyncio>`_ for Python 3.3). This makes it possible to combine the two libraries on the same event loop. Most applications should use `AsyncIOMainLoop` to run Tornado on the default ``asyncio`` event loop. Applications that need to run event loops on multiple threads may use `AsyncIOLoop` to create multiple loops. .. note:: Tornado requires the `~asyncio.AbstractEventLoop.add_reader` family of methods, so it is not compatible with the `~asyncio.ProactorEventLoop` on Windows. Use the `~asyncio.SelectorEventLoop` instead. � )�absolute_import�division�print_functionN)�convert_yielded)�IOLoop)� stack_contextc st e Zd Zd� fdd� Zddd�Zdd� Zdd � Zd d� Zdd � Zdd� Z dd� Z dd� Zdd� Zdd� Z e Z� ZS )�BaseAsyncIOLoopFc sB t t| �jdi |�� || _|| _i | _t� | _t� | _d| _ d S )NF� ) �superr � initialize�asyncio_loop� close_loop�handlers�set�readers�writers�closing)�selfr r �kwargs�� __class__r �U/opt/saltstack/salt/lib/python3.10/site-packages/salt/ext/tornado/platform/asyncio.pyr - s zBaseAsyncIOLoop.initializec C sT d| _ t| j�D ]}| j| \}}| �|� |r| �|� q| jr(| j�� d S d S )NT)r �listr �remove_handlerZclose_fdr r �close)r Zall_fds�fd�fileobj�handler_funcr r r r 8 s ��zBaseAsyncIOLoop.closec C s� | � |�\}}|| jv rtd| ��|t�|�f| j|<