
    i{
                     ~    S SK rS SKrS SKJr  S SKJr  S SKJrJ	r	   " S S\5      r
 " S S\
5      r " S	 S
\
5      rg)    N)abstractmethod)BrokenProcessPool)BaseExecutorrun_jobc                   B   ^  \ rS rSr\U 4S j5       rS rSS jrSrU =r	$ )BasePoolExecutor	   c                 .   > [         TU ]  5         Xl        g N)super__init___pool)selfpool	__class__s     G/app/mltbenv/lib/python3.13/site-packages/apscheduler/executors/pool.pyr   BasePoolExecutor.__init__
   s    
    c                    ^ ^ UU 4S jnT R                   R                  [        TTR                  UT R                  R
                  5      nUR                  U5        g )Nc                 >  > [        U S5      (       a  U R                  5       O*U R                  5       [        U R                  5       SS 5      4u  pU(       a  TR	                  TR
                  X5        g TR                  TR
                  U R                  5       5        g )Nexception_info__traceback__)hasattrr   	exceptiongetattr_run_job_errorid_run_job_successresult)fexctbjobr   s      r   callback1BasePoolExecutor._do_submit_job.<locals>.callback   sx     1.//   "kkmWQ[[]OT%RS C
 ##CFFC4%%cffahhj9r   )r   submitr   _jobstore_alias_loggernameadd_done_callback)r   r#   	run_timesr$   r    s   ``   r   _do_submit_jobBasePoolExecutor._do_submit_job   sI    		: JJS#--y$,,:K:K
 	
H%r   c                 :    U R                   R                  U5        g r   )r   shutdown)r   waits     r   r/   BasePoolExecutor.shutdown    s    

D!r   )r   )T)
__name__
__module____qualname____firstlineno__r   r   r,   r/   __static_attributes____classcell__r   s   @r   r   r   	   s$     &"" "r   r   c                   0   ^  \ rS rSrSrSU 4S jjrSrU =r$ )ThreadPoolExecutor$   a  
An executor that runs jobs in a concurrent.futures thread pool.

Plugin alias: ``threadpool``

:param max_workers: the maximum number of spawned threads.
:param pool_kwargs: dict of keyword arguments to pass to the underlying
    ThreadPoolExecutor constructor
c                    > U=(       d    0 n[         R                  R                  " [        U5      40 UD6n[        TU ]  U5        g r   )
concurrentfuturesr:   intr   r   r   max_workerspool_kwargsr   r   s       r   r   ThreadPoolExecutor.__init__/   s:    !'R!!44S5EUUr    
   N)r2   r3   r4   r5   __doc__r   r6   r7   r8   s   @r   r:   r:   $   s     r   r:   c                   <   ^  \ rS rSrSrSU 4S jjrU 4S jrSrU =r$ )ProcessPoolExecutor5   a  
An executor that runs jobs in a concurrent.futures process pool.

Plugin alias: ``processpool``

:param max_workers: the maximum number of spawned processes.
:param pool_kwargs: dict of keyword arguments to pass to the underlying
    ProcessPoolExecutor constructor
c                   > U=(       d    0 U l         U R                   R                  S[        R                  " S5      5        [        R
                  R                  " [        U5      40 U R                   D6n[        TU ]%  U5        g )N
mp_contextspawn)
rB   
setdefaultmultiprocessingget_contextr=   r>   rI   r?   r   r   r@   s       r   r   ProcessPoolExecutor.__init__@   sl    &,"##L/2M2Mg2VW!!55
 $ 0 0
 	r   c                   >  [         TU ]  X5        g ! [         am    U R                  R	                  S5        U R
                  R                  " U R
                  R                  40 U R                  D6U l        [         TU ]  X5         g f = f)Nz<Process pool is broken; replacing pool with a fresh instance)	r   r,   r   r(   warningr   r   _max_workersrB   )r   r#   r+   r   s      r   r,   "ProcessPoolExecutor._do_submit_jobH   s{    		3G"32  	3LL  N --

''+/+;+;DJ G"32	3s    A4B
	B
)r   rB   rE   )	r2   r3   r4   r5   rG   r   r,   r6   r7   r8   s   @r   rI   rI   5   s    
3 
3r   rI   )concurrent.futuresr=   rO   abcr   concurrent.futures.processr   apscheduler.executors.baser   r   r   r:   rI   rD   r   r   <module>rZ      s:       8 <"| "6) "3* 3r   