-
Notifications
You must be signed in to change notification settings - Fork 34
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
break: refreshable/v2 with Generic type handling #252
Conversation
3cfdc4c
to
64aa0ff
Compare
89c7597
to
6fc9aa0
Compare
refreshable/async.go
Outdated
r.cancel() | ||
r.in.Update(val) |
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.
Shouldn't the order here be reversed?
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.
yep, fixed, thanks!
refreshable/async.go
Outdated
// NewFromTickerFunc returns a Ready Refreshable populated by the result of the provider called each interval. | ||
// If the providers bool return is false, the value is ignored. | ||
// The result's ReadyC channel is closed when a new value is populated. | ||
func NewFromTickerFunc[T any](interval time.Duration, provider func() (T, bool)) (Ready[T], UnsubscribeFunc) { |
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.
Can we pass context into the provider function so that clients can make use of it (e.g. for logging unexpected behaviour)
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.
done!
👍 |
This change is