File manager - Edit - /opt/saltstack/salt/lib/python3.10/site-packages/salt/ext/tornado/platform/__pycache__/caresresolver.cpython-310.pyc
Back
o ;j; � @ s` d dl mZmZmZ d dlZd dlZd dlmZ d dlm Z d dl mZmZ G dd� de�Z dS )� )�absolute_import�division�print_functionN)�gen)�IOLoop)�Resolver�is_valid_ipc @ s: e Zd ZdZddd�Zdd� Zdd� Zejd d d��Z dS )� CaresResolvera> Name resolver based on the c-ares library. This is a non-blocking and non-threaded resolver. It may not produce the same results as the system resolver, but can be used for non-blocking resolution when threads cannot be used. c-ares fails to resolve some names when ``family`` is ``AF_UNSPEC``, so it is only recommended for use in ``AF_INET`` (i.e. IPv4). This is the default for ``tornado.simple_httpclient``, but other libraries may default to ``AF_UNSPEC``. .. versionchanged:: 4.1 The ``io_loop`` argument is deprecated. Nc C s( |pt �� | _tj| jd�| _i | _d S )N)Z sock_state_cb)r �current�io_loop�pycaresZChannel�_sock_state_cb�channel�fds)�selfr � r �[/opt/saltstack/salt/lib/python3.10/site-packages/salt/ext/tornado/platform/caresresolver.py� initialize s zCaresResolver.initializec C s~ |rt jnd|rt jndB }|s| j�|� | j|= d S || jv r/| j�||� || j|<