-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
feat: simplify event service interface #14859
Conversation
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.
lgtm, could you update the ADR as well please?
Are we still thinking of having a bundle service with all the interfaces combined? In that case the long method names would be useful |
I think an optional one could be good, but not required. Agree maybe we keep the names for a future where we have bundled service. |
closing this because of the point Aaron rose on bundled services |
I'm not a huge fan of the bundled service personally but I can see why people would want it to reduce verbosity. An alternative to the long names is going back to using an event manager and then we have a service method GetEventManager |
oh sorry I thought you were for it. I don't have a strong preference, happy to reopen and merge this |
Let's discuss in the next call. I think the bundle service might be preferred by some users |
Let's reopen and close once we have decision. |
@aaronc , what is a bundle service? I don't see any Github issue about it. |
Co-authored-by: Aleksandr Bezobchuk <[email protected]>
I think the conversation about that concept may be tracked back to this PR comment |
Based on our call today, I think we want to do something like this: package event
type Service interface {
EventManager(context.Context) Manager
}
type Manager interface {
Emit(event protoiface.MessageV1) error
EmitKV(eventType string, attrs ...Attribute) error
EmitNonConsensus(event protoiface.MessageV1) error
} This will allow for a bundle service and shorter names. Usage would be How does that sound? |
Why introducing the |
To support a service bundle as described in #12972 (comment), i.e. type Service interface {
event.Service
store.KVStoreService
store.MemoryStoreService
gas.Service
...
} |
@robert-zaremba is it okay if I push this over the finish line? |
@tac0turtle , as you prefer |
Co-authored-by: Aleksandr Bezobchuk <[email protected]> Co-authored-by: marbar3778 <[email protected]>
Description
Simplify the core/event service interface, by making the method names shorter. Some methods were rather long, and we can simplify by removing some part from the composed names which are 'obvious' from the context (package name, type name).
Related to: #14686
cc: @aaronc
Author Checklist
All items are required. Please add a note to the item if the item is not applicable and
please add links to any relevant follow up issues.
I have...
!
to the type prefix if API or client breaking changeCHANGELOG.md
Reviewers Checklist
All items are required. Please add a note if the item is not applicable and please add
your handle next to the items reviewed if you only reviewed selected items.
I have...
!
in the type prefix if API or client breaking change