/opt/cloudlinux/venv/lib/python3.11/site-packages/xray/agent/__pycache__
Edit: /opt/cloudlinux/venv/lib/python3.11/site-packages/xray/agent/__pycache__/executor.cpython-311.pyc (3683B)
§
ð ˜j“ ã ól — d dl Z d dlZd dlmZmZ d dlmZ e j e¦ « Z G d„ d¦ « Z
dS )é N)ÚThreadPoolExecutorÚFuture)ÚBoundedSemaphorec ó> — e Zd ZdZd„ Zd„ Zd„ Zd„ Zdd„Zde fd „Z
d
S )ÚBoundedThreadExecutora9
BoundedExecutor behaves as a ThreadPoolExecutor which will block on
calls to submit() once the limit given as "bound" work items are queued for
execution.
While processing incoming connections, we need two things:
- the server must be able to process incoming connections
in multiple threads (one for each client) because we spend some time
trying to redirect incoming data to our servers
- the server must have some limit in order not to create new
threads indefinitely
This executor has two limits:
:param max_workers - which limits number of simultaneously running threads
:param maxqueuesize - which limits number of tasks to wait for the available thread
When both max_workers and maxqueuesize overflow, .submit function raises
queue.Full exception.
c ó^ — t |¬¦ « | _ t ||z ¦ « | _ d S )N)Úmax_workers)r Úexecutorr Ú semaphore)ÚselfÚmaxqueuesizer s úJ/opt/cloudlinux/venv/lib64/python3.11/site-packages/xray/agent/executor.pyÚ__init__zBoundedThreadExecutor.__init__# s, € Ý*°{ÐCÑCÔCˆŒ
Ý)¨,¸Ñ*DÑEÔEˆŒˆˆó c ó — | S ©N© )r s r Ú __enter__zBoundedThreadExecutor.__enter__' s € ؈r c ó. — | ¦ « d S r )Úshutdown)r Úexc_typeÚexc_valÚexc_tbs r Ú__exit__zBoundedThreadExecutor.__exit__* s € Ø�
Š
‰Œˆˆˆr c óø — | j d¬¦ « }|st j ‚ | j j |g|¢R i |¤Ž}| | j ¦ « |S # | j ¦ « ‚ xY w)NF)Úblocking) r ÚacquireÚqueueÚFullr
ÚsubmitÚadd_done_callbackÚ_on_future_completeÚrelease)r ÚfnÚargsÚkwargsÚsuccessÚfutures r r zBoundedThreadExecutor.submit- s‘ € Ø”.×(Ò(°%Ð(Ñ8Ô8ˆØð Ý”*Ðð Ø)�T”]Ô)¨"Ð>¨tÐ>Ð>Ð>°vÐ>Ð>ˆFð
×$Ò$ TÔ%=Ñ>Ô>Ð>؈Møð ØŒN×"Ò"Ñ$Ô$Ð$Øøøøs «A ÁA9Tc ó: — | j |¦ « d S r )r
r )r Úwaits r r zBoundedThreadExecutor.shutdown; s € ØŒ
×Ò˜tÑ$Ô$Ð$Ð$Ð$r Úxc ó˜ — | j ¦ « | ¦ « rt d¦ « d S d S )NzFuture completed with exception)r r# Ú exceptionÚlogger)r r+ s r r" z)BoundedThreadExecutor._on_future_complete> sN € ØŒ×ÒÑ Ô Ð à�;Š;‰=Œ=ð @Ý×ÒÐ>Ñ?Ô?Ð?Ð?Ð?ð @ð @r N)T)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r r r r r r r" r r r r r s“ € € € € € ðð ð&Fð Fð Fðð ð ðð ð ðð ð ð%ð %ð %ð %ð@ Vð @ð @ð @ð @ð @ð @r r )Úloggingr Úconcurrent.futuresr r Ú threadingr Ú getLoggerr/ r. r r r r ú
r7 s‘ ðà €€€ð
€€€Ø 9Ð 9Ð 9Ð 9Ð 9Ð 9Ð 9Ð 9Ø &Ð