-
Notifications
You must be signed in to change notification settings - Fork 45
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 context based Run API #29
Merged
SuperQ
merged 2 commits into
prometheus-community:main
from
TheRushingWookie:add_context
Apr 11, 2023
Merged
Add context based Run API #29
SuperQ
merged 2 commits into
prometheus-community:main
from
TheRushingWookie:add_context
Apr 11, 2023
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
TheRushingWookie
force-pushed
the
add_context
branch
2 times, most recently
from
April 3, 2023 23:07
64d69b5
to
cc9e4e8
Compare
SuperQ
reviewed
Apr 4, 2023
We only support the last 2 Go releases, so there's no need to worry about Go older than 1.18. |
TheRushingWookie
force-pushed
the
add_context
branch
6 times, most recently
from
April 4, 2023 17:22
cb1da95
to
8adffb1
Compare
Fixed lint issues |
TheRushingWookie
force-pushed
the
add_context
branch
from
April 4, 2023 17:23
8adffb1
to
6042a5c
Compare
Hipska
approved these changes
Apr 6, 2023
SuperQ
reviewed
Apr 6, 2023
SuperQ
approved these changes
Apr 6, 2023
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor naming nit, otherwise LGTM.
Signed-off-by: TheRushingWookie <3181551+TheRushingWookie@users.noreply.github.com>
…tPacketConnOK's member variables Signed-off-by: TheRushingWookie <3181551+TheRushingWookie@users.noreply.github.com>
TheRushingWookie
force-pushed
the
add_context
branch
from
April 6, 2023 15:37
6042a5c
to
8b025e3
Compare
Hipska
approved these changes
Apr 6, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This adds a context based API. This is useful for code which has an existing context and wants to rely on that instead of using a timeout or a count of packets to stop the pinger. When the context is canceled, the ping object is stopped.
I've also added a mutex to the tests as there is a data race detected in testPacketConnOK
See
Compatibility
This change is backwards compatible for the current API but brings in a new dependency, context, which was added in Go 1.7. If a user is on an older than 1.7 version then they will not be able to move to the new version of pro-bing without upgrading their go version.
Testing
Added two unit tests