Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor RequestHandler.handleChannel to only take a Publisher<Payloa…
…d> as argument. The `initialPayload` was already part of the `payloads` publisher, this was very confusing. + Fix the tests impacted by the new API. + Code style: Ensure lines length < 100 characters
- Loading branch information
adb7ce5
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.
We very consciously separated out the initialPayload. Why are you reverting that? It makes routing decisions on the initialPayload more expensive and difficult.
adb7ce5
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.
The unit test proving the issue was refactored to break the point of what was being tested. It no longer routes to the 'echo' method was it was suppose to. Now to do routing decisions on the initial frame the stream must be multicasted so both the router, and the method can subscribe to it. This is much more complicated logic for the standard case of routing based on the initial frame. Routing is almost always needed in applications.
adb7ce5
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.
The motivation behind this change was to simplify the implementation of a RequestHandler (from a user point of view). I was trying simplify the non-routing logic.
I didn't have the context behind the decision of introducing the
initialRequest
, it all makes sense now.I'll refactor.
adb7ce5
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.
@stevegury cool. Glad it makes sense. I should have put more information in the javadocs!