-
Notifications
You must be signed in to change notification settings - Fork 1
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
Events controller #40
Conversation
…tion for workqueue controllers
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.
A few comments. Apologies for the delay in getting this reviewed.
go monitor() | ||
defer close(doneCh) | ||
|
||
return n.conditionHandlerFactory().Handle(ctx, cond, conditionStatusPublisher) |
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.
I'm not really a fan of the factory idiom here. n.conditionHandler
could be a function pointer (the equivalent of what is allocated from the factory).
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.
There's a need for offline discussion but this is functional now and can be revised later.
Events controller abstracts the NATS JS, KV interaction for workqueue specific controllers.
This offloads all the boiler plate for NATS config and events, KV interaction from controllers.
Callers create a new controller instance with the required parameters,
connect,
register an event handler factory method and listen for events,
a functional implementation is here metal-toolbox/flasher#144