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

Add a way to cancel a timer #10

Merged
merged 3 commits into from
Oct 13, 2024
Merged

Add a way to cancel a timer #10

merged 3 commits into from
Oct 13, 2024

Conversation

schneems
Copy link
Collaborator

When dealing with network IO it's expected that we will need to retry. There's currently no good way to advertise what's happening to a user.

This new public API allows for canceling of running timers (without emitting "Done") after which time the timer can be restarted. That allows for an output that could look like this:

- JVM version 8.0.0
  - Downloading JVM .... (retrying in 1 second)
  - Retrying ....... (retrying in 2 seconds)
  - Retrying ...... (Done 4s)

schneems added a commit that referenced this pull request Oct 10, 2024
I already had to write it for the Ruby buildpack (https://github.com/heroku/buildpacks-ruby/blob/c8cdfd0be3a61f7b50d36cae12ec3d22f8068afc/buildpacks/ruby/src/layers/shared.rs#L146), it's useful to have here, and it's useful to show the result of an output in tests like #10.
schneems added a commit that referenced this pull request Oct 10, 2024
I already had to write it for the Ruby buildpack (https://github.com/heroku/buildpacks-ruby/blob/c8cdfd0be3a61f7b50d36cae12ec3d22f8068afc/buildpacks/ruby/src/layers/shared.rs#L146), it's useful to have here, and it's useful to show the result of an output in tests like #10.
When dealing with network IO it's expected that we will need to retry. There's currently no good way to advertise what's happening to a user.

This new public API allows for canceling of running timers (without emitting "Done") after which time the timer can be restarted. That allows for an output that could look like this:

```
- JVM version 8.0.0
  - Downloading JVM .... (retrying in 1 second)
  - Retrying ....... (retrying in 2 seconds)
  - Retrying ...... (Done 4s)
```
@schneems schneems force-pushed the schneems/interrupt-api branch from 938a342 to 5f28e04 Compare October 13, 2024 01:56
@schneems schneems merged commit 913471c into main Oct 13, 2024
4 checks passed
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.

1 participant