| Server IP : 104.21.21.239 / Your IP : 216.73.217.39 Web Server : Apache/2.4.68 (Amazon Linux) OpenSSL/3.5.5 System : Linux ip-172-31-69-123.ec2.internal 6.1.176-223.369.amzn2023.x86_64 #1 SMP PREEMPT_DYNAMIC Fri Jul 24 13:34:27 UTC 2026 x86_64 User : ec2-user ( 1000) PHP Version : 8.4.23 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /lib64/python3.9/site-packages/awscrt/__pycache__/ |
Upload File : |
a
ů�i�q � @ sP d Z ddlZddlmZ ddlmZ ddlZddlmZ G dd� de�Z dd � Z
d
d� ZG dd
� d
e�ZG dd� de�Z
G dd� de
�ZG dd� de�Zdd� ZG dd� de�ZG dd� de�ZG dd� d�ZG dd� de�ZG dd� de�ZG d d!� d!�ZG d"d#� d#e�ZG d$d%� d%e�Zd&d'� Zd(d)� ZG d*d+� d+e�ZG d,d-� d-e�ZdS ).z�
I/O library for `awscrt`.
All networking in `awscrt` is asynchronous.
Long-running event-loop threads are used for concurrency.
� N)�NativeResource)�IntEnum)�Unionc @ s( e Zd ZdZdZdZdZdZdZdZ dS ) �LogLevelr � � � � � � N)
�__name__�
__module__�__qualname__ZNoLogsZFatal�ErrorZWarnZInfoZDebugZTrace� r r �//usr/lib64/python3.9/site-packages/awscrt/io.pyr s r c C s( | dusJ �|dusJ �t �| |� dS )a Initialize logging in `awscrt`.
Args:
log_level (LogLevel): Display messages of this importance and higher.
file_name (str): Logging destination. To write to stdout or stderr pass
'stdout' or 'stderr' as strings. Otherwise, a file path is assumed.
N)�_awscrt�init_logging)� log_level� file_namer r r r s r c C s | dusJ �t �| � dS )z�Change the log level of `awscrt`. init_logging() must have been called
before using this function or else an exception will be raised.
Args:
log_level (LogLevel): Display messages of this importance and higher.
N)r �
set_log_level)r r r r r * s r c sJ e Zd ZdZdZe�� ZdZd
� fdd� Z e
dd� �Ze
dd � �Z� Z
S )�EventLoopGroupaa A collection of event-loops.
An event-loop is a thread for doing async work, such as I/O. Classes that
need to do async work will ask the EventLoopGroup for an event-loop to use.
Args:
num_threads (Optional[int]): Maximum number of event-loops to create.
If unspecified, one is created for each processor on the machine.
cpu_group (Optional[int]): Optional processor group to which all
threads will be pinned. Useful for systems with non-uniform
memory access (NUMA) nodes. If specified, the number of threads
will be capped at the number of processors in the group.
Attributes:
shutdown_event (threading.Event): Signals when EventLoopGroup's threads
have all finished shutting down. Shutdown begins when the
EventLoopGroup object is destroyed.
N�shutdown_eventc s\ t � �� |d u rd}|d u r(d}d}nd}t�� � � fdd�}� | _t�||||�| _d S )Nr FTc s � � � d S �N��setr �r r r �on_shutdown^ s z,EventLoopGroup.__init__.<locals>.on_shutdown)�super�__init__� threading�Eventr r Zevent_loop_group_new�_binding)�selfZnum_threadsZ cpu_groupZ is_pinnedr �� __class__r r r O s
zEventLoopGroup.__init__c C sB t j�( t jd u rt � t _t jW d � S 1 s40 Y d S r �r �_static_event_loop_group_lock�_static_event_loop_groupr r r r �get_or_create_static_defaultd s
z+EventLoopGroup.get_or_create_static_defaultc C s0 t j� d t _W d � n1 s"0 Y d S r r&