\L i{ ~ddlZddlZddlmZddlmZddlmZm Z GddeZ Gdde Z Gd d e Z y) N)abstractmethod)BrokenProcessPool) BaseExecutorrun_jobc6eZdZefdZdZddZxZS)BasePoolExecutorc0t|||_yN)super__init___pool)selfpool __class__s `/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/apscheduler/executors/pool.pyr zBasePoolExecutor.__init__ s  cfd}jjtj|jj }|j |y)Nc.t|dr|jn*|jt|jddf\}}|rj j ||yj j |jy)Nexception_info __traceback__)hasattrr exceptiongetattr_run_job_errorid_run_job_successresult)fexctbjobrs rcallbackz1BasePoolExecutor._do_submit_job..callbacksy1./  "kkmWQ[[]OT%RS C ##CFFC4%%cffahhj9r)r submitr_jobstore_alias_loggernameadd_done_callback)rr! run_timesr"rs`` r_do_submit_jobzBasePoolExecutor._do_submit_jobsI : JJ   S#--y$,,:K:K  H%rc:|jj|yr )r shutdown)rwaits rr+zBasePoolExecutor.shutdown s D!r)T)__name__ __module__ __qualname__rr r)r+ __classcell__rs@rrr s&""rrc$eZdZdZdfd ZxZS)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|xsi}tjjt|fi|}t||yr ) concurrentfuturesr3intr r r max_workers pool_kwargsrrs rr zThreadPoolExecutor.__init__/s:!'R !!44S5EUU r N)r-r.r/__doc__r r0r1s@rr3r3$srr3c.eZdZdZdfd ZfdZxZS)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|xsi|_|jjdtjdt j j t|fi|j}t|%|y)N mp_contextspawn) r: setdefaultmultiprocessing get_contextr5r6r?r7r r r8s rr zProcessPoolExecutor.__init__@sl&," ##L/2M2Mg2VW!!55   $ 0 0  rc t|||y#t$rn|jj d|j j |j jfi|j|_t|||YywxYw)NzrNs:8<"|"6)"3*3r