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
[module] Suggestions for #1275 #1308
[module] Suggestions for #1275 #1308
Conversation
Possibly superfluous: - type assertions to be able to use a function on Context instances that are actually IrrecoverableSignalerContext, Possibly missing: - do we need to demo more in the component. E.g. RunComponent may demo cleanup, etc?
af746b5
to
afb4e6d
Compare
26ad838
to
4c947a1
Compare
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.
Thanks @huitseeker, pretty excited about this :)
Just one last comment, otherwise it looks good!
module/errorhandler/erroraware.go
Outdated
// shutdown the component, | ||
cancel() | ||
// wait until it's doneC | ||
<-done |
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.
While we are waiting for done
, its possible the parentCtx
could be cancelled.
In this case, we should abort waiting for shutdown to complete and exit the function. Otherwise, we will still proceed to the handler(err, restart)
below even though the parent ctx is cancelled.
I think we just need an additional select
statement wrapping this <-done
.
This shows an
IrrecoverableErrorHandler
, with (separate) integration intocontext
andRunComponent
+ReadyDoneAware
.Possibly superfluous:
Possibly missing: