-
Notifications
You must be signed in to change notification settings - Fork 356
Adds specific requestChannel(Payload, Publisher<Payload>) #572
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
…uestChannel Signed-off-by: Robert Roeser <[email protected]>
43d44ee
to
48acae8
Compare
import reactor.core.publisher.Flux; | ||
|
||
/** | ||
* Extends the {@link RSocket} that allows an implementor to peek at the first request payload of a channel. |
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.
* Extends the {@link RSocket} that allows an implementor to peek at the first request payload of a channel. | |
* Extends the {@link RSocket} that allows an implementer to peek at the first request payload of a channel. |
*/ | ||
public interface RequestHandler extends RSocket { | ||
/** | ||
* Implement this method to peak at the first payload of the incoming request stream |
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.
Maybe clarify that peak means that payloads still includes the peaked payload.
Signed-off-by: Robert Roeser <[email protected]>
|
||
private final DuplexConnection connection; | ||
private final RSocket requestHandler; | ||
private final RequestHandler optimizedRequestHandler; | ||
private final boolean hasOptimizedRequestHandler; |
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.
No need for an extra boolean property, just checking optimizedRequestHandler != null should be fine
if (requestHandler instanceof RequestHandler) { | ||
this.optimizedRequestHandler = (RequestHandler) requestHandler; | ||
this.hasOptimizedRequestHandler = true; | ||
this.requestHandler = null; |
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 would keep the requestHandler assigned anyway for consistency.
Signed-off-by: Robert Roeser <[email protected]>
4d69ee2
to
92a4d1d
Compare
Signed-off-by: Robert Roeser <[email protected]>
6eaef08
to
f2a73a8
Compare
* optimize request channel to let you peak at the first item in the requestChannel Signed-off-by: Robert Roeser <[email protected]> * updated javadoc Signed-off-by: Robert Roeser <[email protected]> * updates Signed-off-by: Robert Roeser <[email protected]> * call requestChannelWith 2 arguments Signed-off-by: Robert Roeser <[email protected]> Signed-off-by: Robert Roeser <[email protected]>
* Adds specific requestChannel(Payload, Publisher<Payload>) (#572) * optimize request channel to let you peak at the first item in the requestChannel Signed-off-by: Robert Roeser <[email protected]> * updated javadoc Signed-off-by: Robert Roeser <[email protected]> * updates Signed-off-by: Robert Roeser <[email protected]> * call requestChannelWith 2 arguments Signed-off-by: Robert Roeser <[email protected]> Signed-off-by: Robert Roeser <[email protected]> * first pass at refactoring to idomatic ByteBuf flyweights Signed-off-by: Robert Roeser <[email protected]> * fixing tests Signed-off-by: Robert Roeser <[email protected]> * fixed some more tests Signed-off-by: Robert Roeser <[email protected]> * fix frame flyweights Signed-off-by: Robert Roeser <[email protected]> * testing Signed-off-by: Robert Roeser <[email protected]> * accept ByteBufAllocator in a constructors and renames FrameDecoder to PayloadDecoder Signed-off-by: Robert Roeser <[email protected]> * javadoc Signed-off-by: Robert Roeser <[email protected]> * first pass at refactoring to idomatic ByteBuf flyweights Signed-off-by: Robert Roeser <[email protected]> * fixing tests Signed-off-by: Robert Roeser <[email protected]> * fixed some more tests Signed-off-by: Robert Roeser <[email protected]> * testing Signed-off-by: Robert Roeser <[email protected]> * fix frame flyweights Signed-off-by: Robert Roeser <[email protected]> * accept ByteBufAllocator in a constructors and renames FrameDecoder to PayloadDecoder Signed-off-by: Robert Roeser <[email protected]> * javadoc Signed-off-by: Robert Roeser <[email protected]> * setup frame flyweight: allow null metadata restore micrometer RSocket test Signed-off-by: Maksym Ostroverkhov <[email protected]> * apply fixes from review release ByteBufs in tests Signed-off-by: Maksym Ostroverkhov <[email protected]>
Not sure if this is expected or not but I tried using the Perhaps there needs to be an |
* Adds specific requestChannel(Payload, Publisher<Payload>) (rsocket#572) * optimize request channel to let you peak at the first item in the requestChannel Signed-off-by: Robert Roeser <[email protected]> * updated javadoc Signed-off-by: Robert Roeser <[email protected]> * updates Signed-off-by: Robert Roeser <[email protected]> * call requestChannelWith 2 arguments Signed-off-by: Robert Roeser <[email protected]> Signed-off-by: Robert Roeser <[email protected]> * first pass at refactoring to idomatic ByteBuf flyweights Signed-off-by: Robert Roeser <[email protected]> * fixing tests Signed-off-by: Robert Roeser <[email protected]> * fixed some more tests Signed-off-by: Robert Roeser <[email protected]> * fix frame flyweights Signed-off-by: Robert Roeser <[email protected]> * testing Signed-off-by: Robert Roeser <[email protected]> * accept ByteBufAllocator in a constructors and renames FrameDecoder to PayloadDecoder Signed-off-by: Robert Roeser <[email protected]> * javadoc Signed-off-by: Robert Roeser <[email protected]> * first pass at refactoring to idomatic ByteBuf flyweights Signed-off-by: Robert Roeser <[email protected]> * fixing tests Signed-off-by: Robert Roeser <[email protected]> * fixed some more tests Signed-off-by: Robert Roeser <[email protected]> * testing Signed-off-by: Robert Roeser <[email protected]> * fix frame flyweights Signed-off-by: Robert Roeser <[email protected]> * accept ByteBufAllocator in a constructors and renames FrameDecoder to PayloadDecoder Signed-off-by: Robert Roeser <[email protected]> * javadoc Signed-off-by: Robert Roeser <[email protected]> * setup frame flyweight: allow null metadata restore micrometer RSocket test Signed-off-by: Maksym Ostroverkhov <[email protected]> * apply fixes from review release ByteBufs in tests Signed-off-by: Maksym Ostroverkhov <[email protected]> Signed-off-by: Maksym Ostroverkhov <[email protected]>
Optimize request channel to let you peak at the first item in the stream #569