Your IP : 216.73.216.172


Current Path : /lib/python3/dist-packages/requests_toolbelt/threaded/__pycache__/
Upload File :
Current File : //lib/python3/dist-packages/requests_toolbelt/threaded/__pycache__/thread.cpython-38.pyc

U

�ˀ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)�selfZinitialized_sessionZ	job_queueZresponse_queueZexception_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)	�	threadingZThread�
_make_request�uuidZuuid4�_workerZdaemonZ_state�start�rrrr
rs�zSessionThread._create_workerc
Csnz\z|jjf|�}Wn4tjk
rH}z|j�||f�W5d}~XYnX|j�||f�W5|j��XdSr)	rZ	task_donerZrequest�excZRequestExceptionr
Zputr	)r�kwargsZresponse�errr
�_handle_requests"zSessionThread._handle_requestcCs:z|j��}Wntjk
r(Yq6YnX|�|�qdSr)rZ
get_nowaitrZEmptyr)rrrrr
r&s

zSessionThread._make_requestcCs
|j��S)z*Proxy to the thread's ``is_alive`` method.)r�is_aliverrrr
r/szSessionThread.is_alivecCs|j��dS)z&Join this thread to the master thread.N)r�joinrrrr
r3szSessionThread.joinN)	�__name__�
__module__�__qualname__rrrrrrrrrr
r
s	
	r)
�__doc__rrZrequests.exceptions�
exceptionsrZ_compatr�objectrrrrr
�<module>s