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
Move EventService into HTTP layer #201
Comments
Huge -1 to the first choice. That doesn't really improve the situation: backends are still duplicating the same functionality over and over. +1 to the second-- it gets the job done, but are there missing cases? I'm not sure what you mean by "it gets more complicated w/ direct and indirect resources"… |
The complications with direct/indirect containers is really just that it would likely involve an extra resource lookup, but under option 2, that shouldn't really be that complicated. |
I'll plan to implement the second option. |
👍 |
Nope-- I'm not even sure what I would do with it! |
Notification events are, at present, emitted from within the backend persistence layer, which means that each persistence implementation needs to implement its own logic for emitting notifications. By moving that logic into the HTTP layer, it should be possible to generalize that behavior. This change would also put the code into a good position for supporting WebSocket-based events as in #29.
Before implementing a particular solution here, it seems that the two most obvious paths for implementation would be to either:
ResouceService
methods so that they return aStream<Event>
(in this way, the persistence impl keeps track of the resources that were changed -- it gets more complicated w/ direct and indirect resources), and the HTTP layer simply emits events for whateverEvent
s were returned by theResourceService
.ResourceService
interface at all, and just use the existing public methods to determine which resources changed.I have a preference for the second option, provided that such a design is not overly cumbersome to implement (the first method would be pretty trivial to implement, but it would require all persistence layers to implement their own notification logic).
The text was updated successfully, but these errors were encountered: