Server IP : 209.38.156.173 / Your IP : 216.73.216.122 [ Web Server : Apache/2.4.52 (Ubuntu) System : Linux lakekumayuhotel 5.15.0-136-generic #147-Ubuntu SMP Sat Mar 15 15:53:30 UTC 2025 x86_64 User : root ( 0) PHP Version : 8.1.2-1ubuntu2.22 Disable Function : NONE Domains : 2 Domains MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /lib/python3/dist-packages/twisted/internet/__pycache__/ |
Upload File : |
o �b� � @ sX d Z ddlZddlmZ ddlmZ dd� Zdd� Zd d � Z dd� Z d d� Zg d�ZdS )zY Extended thread dispatching support. For basic support see reactor threading API docs. � N)�defer)�failurec s4 t �� � � �fdd�}|j||g|�R 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 s( | r�� � j|� d S �� � j|� d S �N)�callFromThread�callback�errback)�success�result��d�reactor� �:/usr/lib/python3/dist-packages/twisted/internet/threads.py�onResult* s z#deferToThreadPool.<locals>.onResult)r �Deferred�callInThreadWithCallback)r � threadpool�f�args�kwargsr r r r �deferToThreadPool s r c O s* ddl m} t||�� | g|�R 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 r r r r � deferToThread5 s r c C s"