Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Debian packages RPM packages NuGet packages

Repository URL to install this package:

Details    
python3-tvault-contego / usr / lib / python3.9 / site-packages / contego / __pycache__ / async_utils.cpython-39.pyc
Size: Mime:
a

5½ËhÕã@s@ddlmZmZmZddlmZddlmZdd„Zdd„Z	dS)	é)ÚThreadÚEventÚBoundedSemaphore©Úwraps)ÚRetryExceptioncstˆƒ‡fdd„ƒ}|S)aÛ
        run_async(func)
            function decorator, intended to make "func" run in a separate
            thread (asynchronously).
            Returns the created Thread object

            E.g.:
            @run_async
            def task1():
                do_something

            @run_async
            def task2():
                do_something_too

            t1 = task1()
            t2 = task2()
            ...
            t1.join()
            t2.join()
    cstˆ||d}| ¡|S)N©ÚtargetÚargsÚkwargs)rÚstart)r
rÚfunc_hl©Úfunc©ú7/usr/lib/python3.9/site-packages/contego/async_utils.pyÚ
async_func szrun_async.<locals>.async_funcr©rrrrrÚ	run_async	srcs‡fdd„}|S)Ncstˆƒ‡‡fdd„ƒ}|S)Ncs‚tƒ}‡fdd„}ˆ d¡rvz4| |ˆdœ¡t|||d}| ¡| ¡|WStyrˆ ¡tdƒ‚Yq~0ntdƒ‚dS)NcsF| d¡}| d¡}| ¡z||i|¤ŽWˆ ¡n
ˆ ¡0dS)NÚthread_start_eventÚactual_func)ÚpopÚsetÚrelease)r
rZtheventZthfunc©Ú
throttlingrrÚthread_wrapper_func/s

zYrun_async_by_throttle.<locals>.run_async.<locals>.async_func.<locals>.thread_wrapper_funcF)rrrz	Retry....)	rÚacquireÚupdaterrÚwaitÚ
BaseExceptionrr)r
rZeventrr
)rrrrr+s	
ÿz<run_async_by_throttle.<locals>.run_async.<locals>.async_funcrrrrrr*sz(run_async_by_throttle.<locals>.run_asyncr)rrrrrÚrun_async_by_throttle)sr!N)
Ú	threadingrrrÚ	functoolsrZcontego.exceptionrrr!rrrrÚ<module>s