Ë
    „÷èi{
  ã                   ó~   — d dl Zd dlZd dlmZ d dlmZ d dlmZm	Z	  G d„ de«      Z
 G d„ de
«      Z G d	„ d
e
«      Zy)é    N)Úabstractmethod)ÚBrokenProcessPool)ÚBaseExecutorÚrun_jobc                   ó6   ‡ — e Zd Zeˆ fd„«       Zd„ Zdd„Zˆ xZS )ÚBasePoolExecutorc                 ó0   •— t         ‰| �  «        || _        y ©N)ÚsuperÚ__init__Ú_pool)ÚselfÚpoolÚ	__class__s     €ú]/var/www/pod-logistic/pod-api/venv/lib/python3.12/site-packages/apscheduler/executors/pool.pyr   zBasePoolExecutor.__init__
   s   ø€ ä‰ÑÔØˆ�
ó    c                 ó¸   ‡ ‡— ˆˆ fd„}‰ j                   j                  t        ‰‰j                  |‰ j                  j
                  «      }|j                  |«       y )Nc                 ó.  •— t        | d«      r| j                  «       n*| j                  «       t        | j                  «       dd «      f\  }}|r‰j	                  ‰j
                  ||«       y ‰j                  ‰j
                  | j                  «       «       y )NÚexception_infoÚ__traceback__)Úhasattrr   Ú	exceptionÚgetattrÚ_run_job_errorÚidÚ_run_job_successÚresult)ÚfÚexcÚtbÚjobr   s      €€r   Úcallbackz1BasePoolExecutor._do_submit_job.<locals>.callback   sy   ø€ ô ˜1Ð.Ô/ð × Ñ Ô"à—k‘k“m¤W¨Q¯[©[«]¸OÈTÓ%RÐSñ ˆC�ñ
 Ø×#Ñ# C§F¡F¨C°Õ4à×%Ñ% c§f¡f¨a¯h©h«jÕ9r   )r   Úsubmitr   Ú_jobstore_aliasÚ_loggerÚnameÚadd_done_callback)r   r!   Ú	run_timesr"   r   s   ``   r   Ú_do_submit_jobzBasePoolExecutor._do_submit_job   sI   ù€ õ		:ð �J‰J×ÑÜ�S˜#×-Ñ-¨y¸$¿,¹,×:KÑ:Kó
ˆð 	
×Ñ˜HÕ%r   c                 ó:   — | j                   j                  |«       y r
   )r   Úshutdown)r   Úwaits     r   r+   zBasePoolExecutor.shutdown    s   € Ø�
‰
×Ñ˜DÕ!r   )T)Ú__name__Ú
__module__Ú__qualname__r   r   r)   r+   Ú__classcell__©r   s   @r   r   r   	   s   ø„ Øóó ðò&÷""r   r   c                   ó$   ‡ — e Zd ZdZdˆ fd„	Zˆ xZS )ÚThreadPoolExecutora  
    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                 ó‚   •— |xs i }t        j                  j                  t        |«      fi |¤Ž}t        ‰| �  |«       y r
   )Ú
concurrentÚfuturesr3   Úintr   r   ©r   Úmax_workersÚpool_kwargsr   r   s       €r   r   zThreadPoolExecutor.__init__/   s:   ø€ Ø!Ò' RˆÜ×!Ñ!×4Ñ4´S¸Ó5EÑUÈÑUˆÜ‰Ñ˜Õr   ©é
   N)r-   r.   r/   Ú__doc__r   r0   r1   s   @r   r3   r3   $   s   ø„ ñ÷ñ r   r3   c                   ó.   ‡ — e Zd ZdZdˆ fd„	Zˆ fd„Zˆ xZS )ÚProcessPoolExecutora#  
    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                 óþ   •— |xs i | _         | j                   j                  dt        j                  d«      «       t	        j
                  j                  t        |«      fi | j                   ¤Ž}t        ‰| �%  |«       y )NÚ
mp_contextÚspawn)
r:   Ú
setdefaultÚmultiprocessingÚget_contextr5   r6   r?   r7   r   r   r8   s       €r   r   zProcessPoolExecutor.__init__@   sl   ø€ Ø&Ò,¨"ˆÔØ×Ñ×#Ñ# L´/×2MÑ2MÈgÓ2VÔWÜ×!Ñ!×5Ñ5Ü�Óñ
Ø $× 0Ñ 0ñ
ˆô 	‰Ñ˜Õr   c                 ó  •— 	 t         ‰| �  ||«       y # t        $ rn | j                  j	                  d«        | j
                  j                  | j
                  j                  fi | j                  ¤Ž| _        t         ‰| �  ||«       Y y w xY w)Nz<Process pool is broken; replacing pool with a fresh instance)	r   r)   r   r%   Úwarningr   r   Ú_max_workersr:   )r   r!   r(   r   s      €r   r)   z"ProcessPoolExecutor._do_submit_jobH   s�   ø€ ð		3Ü‰GÑ" 3¨	Õ2øÜ ò 	3Ø�L‰L× Ñ ØNôð .˜Ÿ™×-Ñ-Ø—
‘
×'Ñ'ñØ+/×+;Ñ+;ñˆDŒJô ‰GÑ" 3¨	Ö2ð	3ús   ƒ ”A4BÂ
Br;   )r-   r.   r/   r=   r   r)   r0   r1   s   @r   r?   r?   5   s   ø„ ñõ÷
3ð 
3r   r?   )Úconcurrent.futuresr5   rD   Úabcr   Úconcurrent.futures.processr   Úapscheduler.executors.baser   r   r   r3   r?   © r   r   ú<module>rN      s:   ðÛ Û Ý Ý 8ç <ô"�|ô "ô6Ð)ô ô"3Ð*õ 3r   