golden hour
/opt/saltstack/salt/lib/python3.10/site-packages/salt/ext/tornado/__pycache__
⬆️ Go Up
Upload
File/Folder
Size
Actions
__init__.cpython-310.pyc
378 B
Del
OK
_locale_data.cpython-310.pyc
3.23 KB
Del
OK
auth.cpython-310.pyc
39.18 KB
Del
OK
autoreload.cpython-310.pyc
7.02 KB
Del
OK
concurrent.cpython-310.pyc
17.24 KB
Del
OK
curl_httpclient.cpython-310.pyc
12.8 KB
Del
OK
escape.cpython-310.pyc
9.89 KB
Del
OK
gen.cpython-310.pyc
38.39 KB
Del
OK
http1connection.cpython-310.pyc
19.47 KB
Del
OK
httpclient.cpython-310.pyc
25.19 KB
Del
OK
httpserver.cpython-310.pyc
11.45 KB
Del
OK
httputil.cpython-310.pyc
29.84 KB
Del
OK
ioloop.cpython-310.pyc
33.19 KB
Del
OK
iostream.cpython-310.pyc
42.97 KB
Del
OK
locale.cpython-310.pyc
15.22 KB
Del
OK
locks.cpython-310.pyc
16.61 KB
Del
OK
log.cpython-310.pyc
8.07 KB
Del
OK
netutil.cpython-310.pyc
14.32 KB
Del
OK
options.cpython-310.pyc
19.63 KB
Del
OK
process.cpython-310.pyc
10.27 KB
Del
OK
queues.cpython-310.pyc
11.29 KB
Del
OK
routing.cpython-310.pyc
21.08 KB
Del
OK
simple_httpclient.cpython-310.pyc
16.08 KB
Del
OK
stack_context.cpython-310.pyc
10.65 KB
Del
OK
tcpclient.cpython-310.pyc
6.49 KB
Del
OK
tcpserver.cpython-310.pyc
10.06 KB
Del
OK
template.cpython-310.pyc
30.52 KB
Del
OK
testing.cpython-310.pyc
24.61 KB
Del
OK
util.cpython-310.pyc
13.72 KB
Del
OK
web.cpython-310.pyc
105.22 KB
Del
OK
websocket.cpython-310.pyc
39.08 KB
Del
OK
wsgi.cpython-310.pyc
11.5 KB
Del
OK
Edit: ioloop.cpython-310.pyc
o �xeq� � @ sv d Z ddlmZmZmZ ddlZddlZddlZddlZddl Z ddl Z ddlZddlZddl Z ddlZddlZddlZddlZddlZddlZddlmZmZ ddlmZmZ ddlmZmZ ddlmZ ddlm Z m!Z!m"Z"m#Z# zddl$Z$W n e%y� dZ$Y nw e r�ddl&Z'nddl'Z'd Z(G d d� de)�Z*G dd � d e!�Z+G dd� de+�Z,G dd� de-�Z.G dd� de-�Z/dS )a� An I/O event loop for non-blocking sockets. Typical applications will use a single `IOLoop` object, in the `IOLoop.instance` singleton. The `IOLoop.start` method should usually be called at the end of the ``main()`` function. Atypical applications may use more than one `IOLoop`, such as one `IOLoop` per thread, or per `unittest` case. In addition to I/O events, the `IOLoop` can also schedule time-based events. `IOLoop.add_timeout` is a non-blocking alternative to `time.sleep`. � )�absolute_import�division�print_functionN)�TracebackFuture� is_future)�app_log�gen_log)�set_close_exec�Waker)� stack_context)�PY3�Configurable�errno_from_exception�timedelta_to_secondsg �@c @ s e Zd ZdS )�TimeoutErrorN)�__name__� __module__�__qualname__� r r �K/opt/saltstack/salt/lib/python3.10/site-packages/salt/ext/tornado/ioloop.pyr E s r c @ s� e Zd ZdZdZdZdZdZdZdZ dZ d Zd ZeZ eZeeB Ze�� Ze�� Zedd� �Zed d� �Zdd� Zedd� �ZedTdd��Zdd� Zedd� �Zedd� �Zedd� �ZdUdd �Z dVd"d#�Z!d$d%� Z"d&d'� Z#d(d)� Z$d*d+� Z%d,d-� Z&d.d/� Z'd0d1� Z(d2d3� Z)d4d5� Z*dUd6d7�Z+d8d9� Z,d:d;� Z-d<d=� Z.d>d?� Z/d@dA� Z0dBdC� Z1dDdE� Z2dFdG� Z3dHdI� Z4dJdK� Z5dLdM� Z6dNdO� Z7dPdQ� Z8dRdS� Z9dS )W�IOLoopa� A level-triggered I/O loop. We use ``epoll`` (Linux) or ``kqueue`` (BSD and Mac OS X) if they are available, or else we fall back on select(). If you are implementing a system that needs to handle thousands of simultaneous connections, you should use a system that supports either ``epoll`` or ``kqueue``. Example usage for a simple TCP server: .. testcode:: import errno import functools import tornado.ioloop import socket def connection_ready(sock, fd, events): while True: try: connection, address = sock.accept() except socket.error as e: if e.args[0] not in (errno.EWOULDBLOCK, errno.EAGAIN): raise return connection.setblocking(0) handle_connection(connection, address) if __name__ == '__main__': sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM, 0) sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) sock.setblocking(0) sock.bind(("", port)) sock.listen(128) io_loop = tornado.ioloop.IOLoop.current() callback = functools.partial(connection_ready, sock) io_loop.add_handler(sock.fileno(), callback, io_loop.READ) io_loop.start() .. testoutput:: :hide: By default, a newly-constructed `IOLoop` becomes the thread's current `IOLoop`, unless there already is a current `IOLoop`. This behavior can be controlled with the ``make_current`` argument to the `IOLoop` constructor: if ``make_current=True``, the new `IOLoop` will always try to become current and it raises an error if there is already a current instance. If ``make_current=False``, the new `IOLoop` will not try to become current. .. versionchanged:: 4.2 Added the ``make_current`` keyword argument to the `IOLoop` constructor. � � � � � i i @l r c C s^ t td�s,tj� t td�st� t_W d � tjS W d � tjS 1 s'w Y tjS )a1 Returns a global `IOLoop` instance. Most applications have a single, global `IOLoop` running on the main thread. Use this method to get this instance from another thread. In most other cases, it is better to use `current()` to get the current thread's `IOLoop`. � _instanceN)�hasattrr �_instance_lockr r r r r �instance� s �� ��zIOLoop.instancec C s t td�S )z8Returns true if the singleton instance has been created.r )r r r r r r �initialized� s zIOLoop.initializedc C s t �� rJ �| t _dS )a� Installs this `IOLoop` object as the singleton instance. This is normally not necessary as `instance()` will create an `IOLoop` on demand, but you may want to call `install` to use a custom subclass of `IOLoop`. When using an `IOLoop` subclass, `install` must be called prior to creating any objects that implicitly create their own `IOLoop` (e.g., :class:`tornado.httpclient.AsyncHTTPClient`). N)r r r ��selfr r r �install� s zIOLoop.installc C s t td�r t`dS dS )zKClear the global `IOLoop` instance. .. versionadded:: 4.0 r N)r r r r r r r �clear_instance� s �zIOLoop.clear_instanceTc C s&