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 context methods to Clock interface #12

Merged
merged 2 commits into from
Nov 6, 2023
Merged

Add context methods to Clock interface #12

merged 2 commits into from
Nov 6, 2023

Conversation

justinruggles
Copy link
Contributor

This allows for using timeout/deadline functionality built in to context.Context with a custom clock implementation.

@justinruggles justinruggles requested a review from dfinkel October 26, 2023 13:37
@justinruggles justinruggles force-pushed the context-deadline branch 7 times, most recently from 0ff936d to b4cceae Compare October 26, 2023 15:55
Copy link
Contributor

@dfinkel dfinkel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Generally looks good. Thanks for taking this on!

fake/fake_clock_121.go Outdated Show resolved Hide resolved
fake/fake_clock_121.go Outdated Show resolved Hide resolved
fake/fake_clock_121.go Outdated Show resolved Hide resolved
fake/fake_clock_121.go Show resolved Hide resolved
offset/offset_clock.go Outdated Show resolved Hide resolved
@justinruggles justinruggles force-pushed the context-deadline branch 2 times, most recently from 0f50b7f to 71e0810 Compare October 27, 2023 00:58
@justinruggles justinruggles marked this pull request as ready for review October 27, 2023 00:59
@justinruggles justinruggles force-pushed the context-deadline branch 3 times, most recently from 75e9710 to 0fa94f6 Compare October 27, 2023 13:47
Copy link
Contributor

@dfinkel dfinkel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a few minor comments.

fake/fake_clock_test.go Show resolved Hide resolved
fake/fake_clock_test.go Show resolved Hide resolved
fake/fake_clock_test.go Show resolved Hide resolved
offset/offset_clock_121_test.go Outdated Show resolved Hide resolved
offset/offset_clock_121_test.go Outdated Show resolved Hide resolved
offset/offset_clock_test.go Outdated Show resolved Hide resolved
This allows for using timeout/deadline functionality built in to
context.Context with a custom clock implementation.

Module Go version bumped to 1.19 due to use of atomic.Bool
Copy link
Contributor

@dfinkel dfinkel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Sorry about the delay.

... and thanks for putting this together. I think it'll be rather useful. 🙂

@dfinkel dfinkel merged commit 3d6b352 into master Nov 6, 2023
@dfinkel dfinkel deleted the context-deadline branch November 6, 2023 20:16
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