You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
PollToken should cancel early if the context is canceled #6
This is kind of a nice issue, but in a console app I am working on the app intercepts the os SIGKILL/SIGINT signals to do all of its own graceful shutdown via context, but currently there is no way to cancel the loop in PollToken.
To make this cancelable, it would be nice to something like this into the loop there.
@tomlazar I think that Context should be generally accepted as argument to separate methods, like you proposed, but for the users of the Flow struct, maybe context should also be an additional field on that struct? I'm not sure if adding it to a struct goes against some conventions in how contexts are used in Go. I don't have a lot of experience with them.
Activity
mislav commentedon Mar 30, 2021
That's an excellent suggestion. Thank you!
tomlazar commentedon Mar 30, 2021
I'd love to contribute a PR for this would you like the context to go all the way down from detect flow or just be embedded in that struct?
mislav commentedon Apr 12, 2021
@tomlazar I think that Context should be generally accepted as argument to separate methods, like you proposed, but for the users of the Flow struct, maybe context should also be an additional field on that struct? I'm not sure if adding it to a struct goes against some conventions in how contexts are used in Go. I don't have a lot of experience with them.
You are very welcome to propose a change!