a *Na@s@dZddlZddlZddlmZddlmZGdddeZ dS)z*Module containing the SessionThread class.N)queuec@s<eZdZddZddZddZddZd d Zd d Zd S) SessionThreadcCs$||_||_|||_||_dSN)_session_jobs_create_worker _responses _exceptions)selfZinitialized_sessionZ job_queueZresponse_queueZexception_queuer |/private/var/folders/js/6pj4vh5d4zd0k6bxv74qrbhr0000gr/T/pip-target-22xwyzbs/lib/python/requests_toolbelt/threaded/thread.py__init__ s zSessionThread.__init__cCs4tj|jtd|_d|j_d|j_|jdS)N)targetnameTr) threadingThread _make_requestuuiduuid4_workerdaemon_statestartr r r r rszSessionThread._create_workerc Cs~zlz|jjfi|}Wn6tjyN}z|j||fWYd}~nd}~00|j||fW|jn |j0dSr) rrequestexcRequestExceptionr putr r task_done)r kwargsresponseer r r _handle_requests &zSessionThread._handle_requestcCs8z|j}Wntjy&Yq4Yn0||qdSr)r get_nowaitrEmptyr#)r r r r r r&s  zSessionThread._make_requestcCs |jS)z*Proxy to the thread's ``is_alive`` method.)ris_aliverr r r r&/szSessionThread.is_alivecCs|jdS)z&Join this thread to the master thread.N)rjoinrr r r r'3szSessionThread.joinN) __name__ __module__ __qualname__rrr#rr&r'r r r r r s    r) __doc__rrZrequests.exceptions exceptionsr_compatrobjectrr r r r s