+
    jHàj¦
  ã                  ód   € R t ^ RIHt ^ RIt^ RIt ! R R]P                  P                  4      tR# )zcUnbounded executor for gateway turn bodies (see ``GatewayRunner._get_executor`` in gateway/run.py).)ÚannotationsNc                  óH   € ] tR t^	tRtRR R lltR tRRR/R R llltR	tR
# )Ú_UnboundedThreadExecutoraô  One thread per submitted work item; no queue, no cap.

``ThreadPoolExecutor(max_workers=None)`` is NOT unbounded (it is ``min(32, cpu_count + 4)``),
which is the same silent queue at a larger number. Exposes ``_threads`` and ``_shutdown`` like
``ThreadPoolExecutor`` so ``_stop_pool`` / ``_shutdown_executor`` join and count its workers.
Not ``tools.daemon_pool.DaemonThreadPoolExecutor(sys.maxsize)``: that keeps idle workers alive
until shutdown, whereas here each thread exits when its turn ends.
c               ó   € V ^8„  d   QhRR/# )é   Úthread_name_prefixÚstr© )Úformats   "Ú:/home/ubuntu/.hermes/hermes-agent/gateway/turn_executor.pyÚ__annotate__Ú%_UnboundedThreadExecutor.__annotate__   s   € ÷ ñ ¨3ñ ó    c                	ó€   € Wn         \        4       V n        R V n        \        P
                  ! 4       V n        ^ V n        R# )FN)Ú_prefixÚsetÚ_threadsÚ	_shutdownÚ	threadingÚLockÚ_lockÚ_n)Úselfr   s   &&r   Ú__init__Ú!_UnboundedThreadExecutor.__init__   s,   € Ø)ŒÜ ›UˆŒØˆŒÜ—^’^Ó%ˆŒ
ØˆŽr   c               	óè  a aaaa€ \         P                  P                  4       oVVVVV 3R  lpS P                  ;_uu_ 4        S P                  '       d   \        R4      hS ;P                  ^,          un        \        P                  ! VS P                   RS P                   2RR7      pVP                  4        S P                  P                  V4       RRR4       S#   + '       g   i     S# ; i)c            	     ó   <€  SP                  4       '       gO    SP                  ;_uu_ 4        SP                  P                  \        P
                  ! 4       4       R R R 4       R #  SP                  S! S/ SB 4       SP                  ;_uu_ 4        SP                  P                  \        P
                  ! 4       4       R R R 4       R #   + '       g   i     R # ; i  \         d   p SP                  T 4        R p ? L‚R p ? ii ; i  + '       g   i     R # ; i  SP                  ;_uu_ 4        SP                  P                  \        P
                  ! 4       4       R R R 4       i   + '       g   i     i ; i; i)N)	Úset_running_or_notify_cancelr   r   Údiscardr   Úcurrent_threadÚ
set_resultÚBaseExceptionÚset_exception)ÚexcÚargsÚfnÚfutÚkwargsr   s    €€€€€r   Ú_runÚ-_UnboundedThreadExecutor.submit.<locals>._run   sð   ø€ ð
FØ×7Ñ7×9Ò9Øð —Z—Z“ZØ—M‘M×)Ñ)¬)×*BÒ*BÓ*DÔE÷  ‘Zð+Ø—N‘N¡2 tÐ#6¨vÑ#6Ô7ð
 —Z—Z“ZØ—M‘M×)Ñ)¬)×*BÒ*BÓ*DÔE÷  —Z—Z’Zûô	 %ô +Ø×%Ñ% c×*Ñ*ûð+ú÷  —Z�Zû�T—Z—Z“ZØ—M‘M×)Ñ)¬)×*BÒ*BÓ*DÔE÷  —Z—Z�Zýs^   ƒD ®/CÁ(C  Â/D	ÃC	Ã DÃ+DÃ<D ÄDÄD Ä	D	ÄE=Ä2/E*	Å!	E=Å*E:Å5E=z*cannot schedule new futures after shutdownÚ_T)ÚtargetÚnameÚdaemonN)Ú
concurrentÚfuturesÚFuturer   r   ÚRuntimeErrorr   r   ÚThreadr   Ústartr   Úadd)r   r%   r$   r'   r(   Útr&   s   bbjl  @r   ÚsubmitÚ_UnboundedThreadExecutor.submit   s°   ü€ Ü)3×);Ñ);×)BÑ)BÓ)Dˆ÷	Fñ 	Fð �Z�Z‹ZØ�~�~ˆ~Ü"Ð#OÓPÐPØ�GŠG�q�L�GÜ× Ò ¨°d·l±l°^À1ÀTÇWÁWÀIÐ3NÐW[Ô\ˆAð �G‰GŒIØ�M‰M×Ñ˜aÔ ÷ ð ˆ
÷ ŽZð ˆ
ús   ÁBC Ã C1	Úcancel_futuresFc               ó    € V ^8„  d   QhRRRR/# )r   ÚwaitÚboolr8   r	   )r
   s   "r   r   r   7   s   € ÷ ñ ˜Tð ¸Tñ r   c               	óä   € V P                   ;_uu_ 4        R V n        \        V P                  4      pRRR4       V'       d   X F  pVP	                  4        K  	  R# R#   + '       g   i     L5; i)TN)r   r   Úlistr   Újoin)r   r:   r8   Úthreadsr5   s   &&$  r   ÚshutdownÚ!_UnboundedThreadExecutor.shutdown7   sJ   € à�Z�Z‹ZØ!ˆDŒNÜ˜4Ÿ=™=Ó)ˆG÷ ÷ Û�Ø—‘–ó ñ ÷ �Zús   •AÁA/	)r   r   r   r   r   N)Ú )T)	Ú__name__Ú
__module__Ú__qualname__Ú__firstlineno__Ú__doc__r   r6   r@   Ú__static_attributes__r	   r   r   r   r   	   s"   † ñ÷òñ:ÀE÷ ô r   r   )	rG   Ú
__future__r   Úconcurrent.futuresr.   r   r/   ÚExecutorr   r	   r   r   Ú<module>rL      s)   ðÙ iå "ã Û ô5˜z×1Ñ1×:Ñ:ö 5r   