HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux ip-10-0-8-47 6.8.0-1021-aws #23~22.04.1-Ubuntu SMP Tue Dec 10 16:31:58 UTC 2024 aarch64
User: ubuntu (1000)
PHP: 8.1.2-1ubuntu2.22
Disabled: NONE
Upload Files
File: //usr/lib/python3/dist-packages/requests_toolbelt/threaded/__pycache__/thread.cpython-310.pyc
o

�ˀX��@s@dZddlZddlZddlmZddlmZGdd�de�Z	dS)z*Module containing the SessionThread class.�N�)�queuec@s<eZdZdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Zd
S)�
SessionThreadcCs$||_||_|��||_||_dS�N)�_session�_jobs�_create_worker�
_responses�_exceptions)�self�initialized_session�	job_queue�response_queue�exception_queue�r�C/usr/lib/python3/dist-packages/requests_toolbelt/threaded/thread.py�__init__s

zSessionThread.__init__cCs4tj|jt��d�|_d|j_d|j_|j��dS)N)�target�nameTr)	�	threading�Thread�
_make_request�uuid�uuid4�_worker�daemon�_state�start�rrrrrs�zSessionThread._create_workerc
Cs�z?z|jjdi|��}Wntjy'}z|j�||f�WYd}~nd}~ww|j�||f�W|j��dSW|j��dS|j��w)Nr)	r�request�exc�RequestExceptionr
�putr	r�	task_done)r�kwargs�response�errr�_handle_requests���zSessionThread._handle_requestcCs4	z|j��}WntjyYdSw|�|�qr)r�
get_nowaitr�Emptyr')rr$rrrr&s�
�zSessionThread._make_requestcCs
|j��S)z*Proxy to the thread's ``is_alive`` method.)r�is_aliverrrrr*/s
zSessionThread.is_alivecCs|j��dS)z&Join this thread to the master thread.N)r�joinrrrrr+3szSessionThread.joinN)	�__name__�
__module__�__qualname__rrr'rr*r+rrrrr
s	
	r)
�__doc__rr�requests.exceptions�
exceptionsr �_compatr�objectrrrrr�<module>s