| Server IP : 198.244.165.102 / Your IP : 216.73.216.218 [ Web Server : nginx/1.24.0 System : Linux modovh-ub-01 6.8.0-138-generic #138-Ubuntu SMP PREEMPT_DYNAMIC Fri Jul 31 22:41:49 UTC 2026 x86_64 User : colleary ( 1011) PHP Version : 8.3.23 Disable Function : NONE Domains : 2 Domains MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /lib/python3/dist-packages/twisted/internet/__pycache__/ |
Upload File : |
�
oj� � �� � d Z ddlmZ ddlZddlmZmZ ddlmZ ddl m
Z
ddlmZ ddl
mZ dd lmZ ed
� Z ed� Z dd�Zd
� Zd� Zd� Zd� Zg d�Zy)zY
Extended thread dispatching support.
For basic support see reactor threading API docs.
� )�annotationsN)�Callable�TypeVar)� ParamSpec)�defer)�IReactorFromThreads)�failure)�
ThreadPool�_P�_Rc �n � �� t j � �d�� fd�} |j ||g|��i |�� �S )a3
Call the function C{f} using a thread from the given threadpool and return
the result as a Deferred.
This function is only used by client code which is maintaining its own
threadpool. To run a function in the reactor's threadpool, use
C{deferToThread}.
@param reactor: The reactor in whose main thread the Deferred will be
invoked.
@param threadpool: An object which supports the C{callInThreadWithCallback}
method of C{twisted.python.threadpool.ThreadPool}.
@param f: The function to call.
@param args: positional arguments to pass to f.
@param kwargs: keyword arguments to pass to f.
@return: A Deferred which fires a callback with the result of f, or an
errback with a L{twisted.python.failure.Failure} if f throws an
exception.
c �| �� | r�j �j |� y �j �j |� y �N)�callFromThread�callback�errback)�success�result�d�reactors ���:/usr/lib/python3/dist-packages/twisted/internet/threads.py�onResultz#deferToThreadPool.<locals>.onResult9 s. �� ���"�"�1�:�:�v�6��"�"�1�9�9�f�5� )r �boolr z_R | BaseException�return�None)r �Deferred�callInThreadWithCallback)r �
threadpool�f�args�kwargsr r s ` @r �deferToThreadPoolr# s9 �� �: "�N�N�,�A�6� (�J�'�'��!�E�d�E�f�E��Hr c �L � ddl m} t ||j � | g|��i |��S )at
Run a function in a thread and return the result as a Deferred.
@param f: The function to call.
@param args: positional arguments to pass to f.
@param kwargs: keyword arguments to pass to f.
@return: A Deferred which fires a callback with the result of f,
or an errback with a L{twisted.python.failure.Failure} if f throws
an exception.
r �r )�twisted.internetr r# �
getThreadPool)r r! r"