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: process.cpython-310.pyc
o �xe-2 � @ sD d Z ddlmZmZmZ ddlZddlZddlZddlZddl Z ddl Z ddlmZ ddl mZ ddlmZ ddlmZ ddlmZ dd lmZ dd lmZ ddlmZmZ zddlZW n eyg dZY nw erleZzejZW n e y� dej!vr~� Y nw d d� Z"dd� Z#dd� Z$da%ddd�Z&dd� Z'G dd� de(�Z)dS )z�Utilities for working with multiple processes, including both forking the server into multiple processes and managing subprocesses. � )�absolute_import�division�print_functionN)�hexlify)�Future)�ioloop)�PipeIOStream)�gen_log)�set_close_exec)� stack_context)�errno_from_exception�PY3ZAPPENGINE_RUNTIMEc C s\ t du rdS zt �� W S ty Y nw zt�d�W S ttfy& Y nw t�d� dS )z1Returns the number of processors on this machine.N� �SC_NPROCESSORS_CONFz1Could not detect number of processors; assuming 1) �multiprocessing� cpu_count�NotImplementedError�os�sysconf�AttributeError� ValueErrorr �error� r r �L/opt/saltstack/salt/lib/python3.10/site-packages/salt/ext/tornado/process.pyr = s �� r c C sh dt jvrd S dd l} zttt�d��d�}W n ty, tt � � d �t� � A }Y nw | �|� d S )N�randomr � i� )�sys�modulesr �longr r �urandomr �int�time�getpid�seed)r r# r r r �_reseed_randomM s �r$ c C s$ t �� \} }t| � t|� | |fS �N)r �piper )�r�wr r r � _pipe_cloexec[ s r) �d c sn t du sJ �| du s| dkrt� } tj�� rtd��t�d| � i � � fdd�}t| �D ]}||�}|dur:| S q,d}� r�zt � � \}}W n tya } zt|�t jkr\W Y d}~q=� d}~ww |� vrgq=� �|�}t �|�r}t�d||t �|�� nt �|�dkr�t�d||t �|�� nt�d ||� q=|d 7 }||kr�td��||�} | dur�| S � s?t�d� dS )ae Starts multiple worker processes. If ``num_processes`` is None or <= 0, we detect the number of cores available on this machine and fork that number of child processes. If ``num_processes`` is given and > 0, we fork that specific number of sub-processes. Since we use processes and not threads, there is no shared memory between any server code. Note that multiple processes are not compatible with the autoreload module (or the ``autoreload=True`` option to `tornado.web.Application` which defaults to True when ``debug=True``). When using multiple processes, no IOLoops can be created or referenced until after the call to ``fork_processes``. In each child process, ``fork_processes`` returns its *task id*, a number between 0 and ``num_processes``. Processes that exit abnormally (due to a signal or non-zero exit status) are restarted with the same id (up to ``max_restarts`` times). In the parent process, ``fork_processes`` returns None if all child processes have exited normally, but will otherwise only exit by throwing an exception. Nr z�Cannot run in multiple processes: IOLoop instance has already been initialized. You cannot call IOLoop.instance() before calling start_processes()zStarting %d processesc s* t �� }|dkrt� | a| S | � |<