eM7nSrSrSSKrSSKrSSKrSSKrSSKJr SSK J r SSK J r SSK J r SS K J r \ Rr\ Rr\ R r\ R"r\R$S- r"S S 5r\rS rS rSrSrSrSrSS.SjrSSKr\R(=rrg!\a gf=f)z.A Future class similar to the one in PEP 3148.)Future wrap_futureisfutureN) GenericAlias) base_futures)events) exceptions)format_helpersc\rSrSrSr\rSrSrSr Sr Sr Sr Sr SrSS.SjrSrSr\"\5r\S 5r\R.S 5rS rS rSS jrSrSrSrSrSrSS.Sjr Sr!Sr"Sr#Sr$\$r%Sr&g)raThis class is *almost* compatible with concurrent.futures.Future. Differences: - This class is not thread-safe. - result() and exception() do not take a timeout argument and raise an exception when the future isn't done yet. - Callbacks registered with add_done_callback() are always called via the event loop's call_soon(). - This class is not compatible with the wait() and as_completed() methods in the concurrent.futures package. (In Python 3.4 or later we may be able to unify the implementations.) NFloopcUc"5UlOXl/UlURR 5(a0[ R "[R"S55Ul gg)zInitialize the future. The optional event_loop argument allows explicitly setting the event loop object used by the future. If it's not provided, the future uses the default event loop. Nr) r get_event_loop_loop _callbacks get_debugr extract_stacksys _getframe_source_tracebackselfrs 5/opt/imh/python3.13/lib/python3.13/asyncio/futures.py__init__Future.__init__Hs\ <..0DJJ ::   ! !%3%A%A a &"D " "c.[R"U5$N)r _future_reprrs r__repr__Future.__repr__Xs((..rcUR(dgURnURRS3UUS.nUR(aURUS'UR R U5 g)Nz exception was never retrieved)message exceptionfuturesource_traceback)_Future__log_traceback _exception __class____name__rrcall_exception_handler)rexccontexts r__del__Future.__del__[sl## oo>>**++IJ    ! !*.*@*@G& ' ))'2rcUR$r )r*r"s r_log_tracebackFuture._log_tracebackms###rc6U(a [S5eSUlg)Nz'_log_traceback can only be set to FalseF) ValueErrorr*)rvals rr4r5qs FG G$rc:URnUc [S5eU$)z-Return the event loop the Future is bound to.z!Future object is not initialized.)r RuntimeErrorrs rget_loopFuture.get_loopws!zz <BC C rcURbURnSUlU$URc[R"5nU$[R"UR5nU$)zCreate the CancelledError to raise if the Future is cancelled. This should only be called once when handling a cancellation since it erases the saved context exception value. N)_cancelled_exc_cancel_messager CancelledError)rr/s r_make_cancelled_errorFuture._make_cancelled_error~sf    *%%C"&D J    '++-C ++D,@,@AC rc~SUlUR[:wag[UlXlUR 5 g)zCancel the future and schedule callbacks. If the future is already done or cancelled, return False. Otherwise, change the future's state to cancelled, schedule the callbacks and return True. FT)r*_state_PENDING _CANCELLEDr?_Future__schedule_callbacks)rmsgs rcancel Future.cancels7 % ;;( "  " !!#rcURSSnU(dg/URSS&UHup#URRX US9 M! g)zInternal: Ask the event loop to call all callbacks. The callbacks are scheduled to be called as soon as possible. Also clears the callback list. Nr0)rr call_soon)r callbackscallbackctxs r__schedule_callbacksFuture.__schedule_callbackssI OOA&  &MH JJ  ='rc(UR[:H$)z(Return True if the future was cancelled.)rDrFr"s r cancelledFuture.cancelleds{{j((rc(UR[:g$)zReturn True if the future is done. Done means either that a result / exception are available, or that the future was cancelled. )rDrEr"s rdone Future.dones {{h&&rc(UR[:XaUR5eUR[:wa[R "S5eSUlURb%URRUR5eUR$)zReturn the result this future represents. If the future has been cancelled, raises CancelledError. If the future's result isn't yet available, raises InvalidStateError. If the future is done and has an exception set, this exception is raised. zResult is not ready.F) rDrFrA _FINISHEDr InvalidStateErrorr*r+with_traceback _exception_tb_resultr"s rresult Future.resultst ;;* $,,. . ;;) #../EF F$ ?? &//001C1CD D||rcUR[:XaUR5eUR[:wa[R "S5eSUlUR$)zReturn the exception that was set on this future. The exception (or None if no exception was set) is returned only if the future is done. If the future has been cancelled, raises CancelledError. If the future isn't done yet, raises InvalidStateError. zException is not set.F)rDrFrArZr r[r*r+r"s rr'Future.exceptionsO ;;* $,,. . ;;) #../FG G$rrLcUR[:waURRXUS9 gUc[R "5nUR RX45 g)zAdd a callback to be run when the future becomes done. The callback is called with a single argument - the future object. If the future is already done when this is called, the callback is scheduled with call_soon. rLN)rDrErrM contextvars copy_contextrappend)rfnr0s radd_done_callbackFuture.add_done_callbacksN ;;( " JJ 7 ;%224 OO " "B= 1rcURVVs/sHup#X!:wdM X#4PM nnn[UR5[U5- nU(aX@RSS&U$s snnf)zmRemove all instances of a callback from the "call when done" list. Returns the number of callbacks removed. N)rlen)rrgfrPfiltered_callbacks removed_counts rremove_done_callbackFuture.remove_done_callbacksh /3oo*.=(1!"'qh.= *DOO,s3E/FF !3OOA  *s A!A!cUR[:wa&[R"URSU<35eXl[ UlUR 5 g)z~Mark the future done and set its result. If the future is already done when this method is called, raises InvalidStateError. : N)rDrEr r[r^rZrG)rr_s r set_resultFuture.set_resultsH ;;( "..$++b/IJ J   !!#rc~UR[:wa&[R"URSU<35e[ U[ 5(aU"5n[ U[ 5(a[S5nXlXl UnXl URUl [UlUR5 SUlg)zMark the future done and set an exception. If the future is already done when this method is called, raises InvalidStateError. rrzPStopIteration interacts badly with generators and cannot be raised into a FutureTN)rDrEr r[ isinstancetype StopIterationr: __cause__ __context__r+ __traceback__r]rZrGr*)rr'new_excs r set_exceptionFuture.set_exceptions ;;( "..$++b/IJ J i & &! I i / /"$,-G!* "+ I#&44  !!##rc## UR5(d SUlUv UR5(d [S5eUR5$7f)NTzawait wasn't used with future)rW_asyncio_future_blockingr:r_r"s r __await__Future.__await__s@yy{{,0D )Jyy{{>? ?{{}sAA) __log_tracebackrrr?r>r+r]rr^rrDr )'r- __module__ __qualname____firstlineno____doc__rErDr^r+rrr?r>rr*rr#r1 classmethodr__class_getitem__propertyr4setterr;rArIrGrTrWr_r'rhrorsr}r__iter____static_attributes__rrrrs&FGJ EON %O#" /3 $L1 $$%% "  >) ' 04 2  $$.Hrrc`URnU"5$![a UR$f=fr )r;AttributeErrorr)futr;s r _get_loopr*s:<<z    99  s  --cRUR5(agURU5 g)z?Helper setting the result only if the future was not cancelled.N)rTrs)rr_s r_set_result_unless_cancelledr6s }}NN6rch[U5nU[RRLa6[R"UR 6R UR5$U[RRLa6[R"UR 6R UR5$U$r ) rw concurrentfuturesr@r argsr\r{r[)r/ exc_classs r_convert_future_excr=sS IJ&&555((#((3BB3CTCTUU j((:: :++SXX6EEcFWFWXX rcNUR5(deUR5(aUR"5 UR"5(dgUR 5nUbUR "[ U55 gUR5nUR"U5 g)z8Copy state from a future to a concurrent.futures.Future.N) rWrTrIset_running_or_notify_cancelr'r}rr_rs)rsourcer'r_s r_set_concurrent_future_staterGs ;;===   2 2 4 4  "I  !4Y!?@f%rcvUR5(deUR5(agUR5(aeUR5(aUR5 gUR5nUbUR [ U55 gUR 5nURU5 g)ziInternal helper to copy state from another Future. The other Future may be a concurrent.futures.Future. N)rWrTrIr'r}rr_rs)rdestr'r_s r_copy_future_staterVs ;;=== ~~yy{{?  $$&    29= >]]_F OOF #rc^^^^^[T5(d4[T[RR5(d [ S5e[T5(d4[T[RR5(d [ S5e[T5(a [ T5OSm[T5(a [ T5OSmSmUUU4SjnUUUU4SjnTRU5 TRU5 g)aChain two futures so that when one completes, so does the other. The result (or exception) of source will be copied to destination. If destination is cancelled, source gets cancelled too. Compatible with both asyncio.Future and concurrent.futures.Future. z(A future is required for source argumentz-A future is required for destination argumentNcR[U5(a [X5 g[X5 gr )rrr)r(others r _set_state!_chain_future.._set_statezs F   u - ( 7rc>UR5(a5TbTTLaTR5 gTRTR5 ggr )rTrIcall_soon_threadsafe) destination dest_loopr source_loops r_call_check_cancel)_chain_future.._call_check_cancels?  " ""kY&> 00? #rc>TR5(aTbTR5(agTbTTLa T"TU5 gTR5(agTRTTU5 gr )rT is_closedr)rrrrrs r_call_set_state&_chain_future.._call_set_statesd  ! ! # #%)*=*=*?*?    [ 8 {F +""$$  * *:{F Kr)rrvrrr TypeErrorrrh)rrrrrrrs`` @@@r _chain_futurerjs F  Jv/9/A/A/H/H%J%JBCC K K4>4F4F4M4M*O*OGHH'/'7'7)F#TK*2;*?*? +&TI8 @ L L!!"45 _-rrc[U5(aU$[U[RR5(d SU<35eUc[ R "5nUR5n[X5 U$)z&Wrap concurrent.futures.Future object.z+concurrent.futures.Future is expected, got ) rrvrrrr r create_futurer)r(r new_futures rrrss fj0077 8 8A 5fZ@A 8 |$$&##%J&% r) r__all__concurrent.futuresrrdloggingrtypesrrr r r rrErFrZDEBUG STACK_DEBUGr _PyFuturerrrrrrr_asyncio_CFuture ImportErrorrrrrs4        $ $  " " mma EER    &$().X!% ( !'FX   sB++B43B4