juliaweb / retry.jl Goto Github PK
View Code? Open in Web Editor NEWMacros for simplified exception handling: @repeat try, @retry, @delay_retry, @protected try, @ignore.
License: Other
Macros for simplified exception handling: @repeat try, @retry, @delay_retry, @protected try, @ignore.
License: Other
From the readme it's not clear what happens if there's a finally
on the try-catch blocks. It would be good to explain when those finally blocks are called in the retry process
Currently, if you use @delay_retry
then the exponent is the constant 10
. This means 5 repeats go from 0.05
-> 0.5
-> 5
-> 50
-> 500
.
If for example, you have an API quota which has 60 second windows, you can't repeat 4 times as you would only cover 55.55 seconds. Instead, you need to go to the next one, which is over 8 minutes long. Being able to set a much smaller exponent would make this infinitely more useful. e.g. if 2 is used:
0.05
-> 0.1
-> 0.2
-> 0.4
-> 0.8
-> 1.6
-> 3.2
-> 6.4
-> 12.8
-> 25.6
-> 51.2
This way we only "waste" 42 seconds. Of course, every API and everyone's usage is different, so there many be many even better reasons to make this configurable.
julia> JET.@report_call AWSS3.s3_get(AWS.global_aws_config(creds = AWS.AWSCredentials("","")), "bucket", "key")
═════ 3 possible errors found ═════
┌ @ C:\.julia\packages\AWSS3\GTR8D\src\AWSS3.jl:121 AWSS3.:(var"#s3_get#4")(AWSS3.nothing, true, false, AWSS3.nothing, Dict{String, Any}(), false, pairs(NamedTuple()), #self#, aws, bucket, path)
│┌ @ C:\.julia\packages\Retry\vS1bg\src\repeat_try.jl:163 goto %69 if not e Retry.:(==) Retry.nothing
││ non-boolean `Missing` found in boolean context (1/2 union split): goto %69 if not (e Retry.:(==) Retry.nothing)::Union{Missing, Bool}
│└────────────────────────────────────────────────────────
│┌ @ C:\.julia\packages\Retry\vS1bg\src\repeat_try.jl:163 goto %85 if not AWSS3.in(AWSS3.ecode(e), Base.vect("NoSuchBucket", "NoSuchKey"))
││ non-boolean `Missing` found in boolean context (1/2 union split): goto %85 if not AWSS3.in(AWSS3.ecode(e::Any)::Any, Base.vect("NoSuchBucket", "NoSuchKey")::Vector{String})::Union{Missing, Bool}
│└────────────────────────────────────────────────────────
│┌ @ C:\.julia\packages\Retry\vS1bg\src\repeat_try.jl:163 goto %69 if not e Retry.:(==) Retry.nothing
││ non-boolean `Missing` found in boolean context (1/2 union split): goto %69 if not (e::Any Retry.:(==) Retry.nothing)::Union{Missing, Bool}
│└────────────────────────────────────────────────────────
Proposed in JuliaCloud/AWSS3.jl#33
JuliaLang/julia#11169 means that taking the value of a try/catch that might return results in "ERROR: syntax: misplaced return statement".
This workaround for the @repeat macro should be removed eventually: a60b90d
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.