-
Notifications
You must be signed in to change notification settings - Fork 167
Re: Proposal for reworking the unstructured read/write of events #150
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
Conversation
|
I'm gonna merge this after the #155 as explained here #155 (comment) |
|
I can't see how you can merge this PR, since it implies that CloudEvent is also a visitor. Of course with the changes proposed in #155 things would need t be reworked and that is a whole new PR that has no relation to this one. |
This PR won't affect the api module, and in any case i need to rework the core module to glue it to api module. Merging this PR just simplifies my job with this reworking and the APIs proposed here will vanish. So please let's just think about reaching the agreement on #155 and then as mantainer i'll figure out what's the best strategy to go forward. I intend to keep from this PR the implementation details, not the APIs |
|
Ok this one is rebased on top of #155 and ready to be merged, it still doesn't use the new apis (followup prs will take care of it). Let me know if there are any concerns about it. |
|
With 101 files changed this is hardly a reviewable PR. We just spent a month debating PR with only 20 changed files. As suggested earlier, please close this PR in favor of manageable and reviewable units properly documented, tested etc. |
|
Most of the changes are due to the rebase commit, I can't split this PR because, as you know, it changes quite some crucial bits in the old interfaces. I want to merge this before re-gluing all things together, because i feel this is the more simple way to solve it and proceed further. I know it's hard, but please try to review it this way. |
Signed-off-by: Francesco Guardiani <francescoguard@gmail.com>
|
I would love to try to import from this pr the new interfaces, but i don't guarantee any success, it will end up for sure in some classpath conflict... Lemme try it |
|
I think we need to step back. I would suggest shifting our energy on building on the foundation that was established with #155, one bit at the time with proper reviews, testing, documentation etc. |
This proposal comes from discussions in #143 and https://docs.google.com/document/d/1VY85Afhb-oj7m9Sm84U_f8kJp6boBS8nnuTMc9tkgO8/edit?usp=sharing
The goal of these changes is to provide an unstructured view of the event and an unstructured manner to write the event, without giving additional burden to the
CloudEventimplementer (likeasStructuredMessage()andasBinaryMessage()does). It's not a goal of this PR to address the other concerns of #143.CloudEventVisitableCloudEventimplementsCloudEventVisitable, which is an interface that defines how an unstructured visit of the message happens.CloudEventprovides a default implementation for it, avoiding to put this burden to theCloudEventimplementer.CloudEventVisitableis used byEventFormatimplementations and protocol binding implementations, keeping low the allocation cost for encoding/decoding an event.Now users can write binary messages using:
While they can write structured message using:
Two helper methods are also provided for that.
CloudEventBuilderandCloudEventVisitor/CloudEventVisitorFactoryCloudEventBuilderis the "write side" ofCloudEvent. Concrete implementations provides "structured write" methods to write theCloudEvent(withId,withSource, etc) and implements theCloudEventVisitor<CloudEvent>interface, which provides "unstructured write" methods to create an event starting from a binary message.Event conversion
The visitAttributes will be used as basis to reimplement specversion conversion, in order to remove the methods on the CloudEvent interface. This is shown in #147
Signed-off-by: Francesco Guardiani francescoguard@gmail.com