Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow timeout to be set via KuberContext #47

Merged
merged 1 commit into from
Jan 10, 2022
Merged

allow timeout to be set via KuberContext #47

merged 1 commit into from
Jan 10, 2022

Conversation

tanmaykm
Copy link
Member

@tanmaykm tanmaykm commented Jan 7, 2022

This allows timeout values to be specified while constructing the KuberContext instance, or modified later through a set_timeout API.
Also provided is a with_timeout API to set a timeout only within a specific scope. E.g.:

ctx = Kuber.KuberContext(; timeout=60, long_polling_timeout=600)

Kuber.set_timeout(ctx, 120)

Kuber.with_timeout(ctx, 300) do ctx
    # use ctx...
end

This allows timeout values to be specified while constructing the KuberContext instance, or modified later through a `set_timeout` API.
Also provided is a `with_timeout` API to set a timeout only within a specific scope. E.g.:

```julia
ctx = Kuber.KuberContext(; timeout=60, long_polling_timeout=600)

Kuber.set_timeout(ctx, 120)

Kuber.with_timeout(ctx, 300) do ctx
    # use ctx...
end
```
@codecov-commenter
Copy link

Codecov Report

Merging #47 (42b55bf) into master (e19f58f) will increase coverage by 0.67%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #47      +/-   ##
==========================================
+ Coverage   64.22%   64.90%   +0.67%     
==========================================
  Files           3        2       -1     
  Lines         355      359       +4     
==========================================
+ Hits          228      233       +5     
+ Misses        127      126       -1     
Impacted Files Coverage Δ
src/helpers.jl 87.35% <100.00%> (+0.96%) ⬆️
src/Kuber.jl

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e19f58f...42b55bf. Read the comment docs.

@tanmaykm tanmaykm merged commit ea91c01 into master Jan 10, 2022
@delete-merged-branch delete-merged-branch bot deleted the tan/misc branch January 10, 2022 05:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants