-
Notifications
You must be signed in to change notification settings - Fork 357
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 <rroeserr@gmail.com>
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 <rroeserr@gmail.com>
| 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.
4d69ee2 to
92a4d1d
Compare
Signed-off-by: Robert Roeser <rroeserr@gmail.com>
6eaef08 to
f2a73a8
Compare
* optimize request channel to let you peak at the first item in the requestChannel Signed-off-by: Robert Roeser <rroeserr@gmail.com> * updated javadoc Signed-off-by: Robert Roeser <rroeserr@gmail.com> * updates Signed-off-by: Robert Roeser <rroeserr@gmail.com> * call requestChannelWith 2 arguments Signed-off-by: Robert Roeser <rroeserr@gmail.com> Signed-off-by: Robert Roeser <rroeserr@gmail.com>
* 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 <rroeserr@gmail.com> * updated javadoc Signed-off-by: Robert Roeser <rroeserr@gmail.com> * updates Signed-off-by: Robert Roeser <rroeserr@gmail.com> * call requestChannelWith 2 arguments Signed-off-by: Robert Roeser <rroeserr@gmail.com> Signed-off-by: Robert Roeser <rroeserr@gmail.com> * first pass at refactoring to idomatic ByteBuf flyweights Signed-off-by: Robert Roeser <rroeserr@gmail.com> * fixing tests Signed-off-by: Robert Roeser <rroeserr@gmail.com> * fixed some more tests Signed-off-by: Robert Roeser <rroeserr@gmail.com> * fix frame flyweights Signed-off-by: Robert Roeser <rroeserr@gmail.com> * testing Signed-off-by: Robert Roeser <rroeserr@gmail.com> * accept ByteBufAllocator in a constructors and renames FrameDecoder to PayloadDecoder Signed-off-by: Robert Roeser <rroeserr@gmail.com> * javadoc Signed-off-by: Robert Roeser <rroeserr@gmail.com> * first pass at refactoring to idomatic ByteBuf flyweights Signed-off-by: Robert Roeser <rroeserr@gmail.com> * fixing tests Signed-off-by: Robert Roeser <rroeserr@gmail.com> * fixed some more tests Signed-off-by: Robert Roeser <rroeserr@gmail.com> * testing Signed-off-by: Robert Roeser <rroeserr@gmail.com> * fix frame flyweights Signed-off-by: Robert Roeser <rroeserr@gmail.com> * accept ByteBufAllocator in a constructors and renames FrameDecoder to PayloadDecoder Signed-off-by: Robert Roeser <rroeserr@gmail.com> * javadoc Signed-off-by: Robert Roeser <rroeserr@gmail.com> * setup frame flyweight: allow null metadata restore micrometer RSocket test Signed-off-by: Maksym Ostroverkhov <m.ostroverkhov@gmail.com> * apply fixes from review release ByteBufs in tests Signed-off-by: Maksym Ostroverkhov <m.ostroverkhov@gmail.com>
|
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 <rroeserr@gmail.com> * updated javadoc Signed-off-by: Robert Roeser <rroeserr@gmail.com> * updates Signed-off-by: Robert Roeser <rroeserr@gmail.com> * call requestChannelWith 2 arguments Signed-off-by: Robert Roeser <rroeserr@gmail.com> Signed-off-by: Robert Roeser <rroeserr@gmail.com> * first pass at refactoring to idomatic ByteBuf flyweights Signed-off-by: Robert Roeser <rroeserr@gmail.com> * fixing tests Signed-off-by: Robert Roeser <rroeserr@gmail.com> * fixed some more tests Signed-off-by: Robert Roeser <rroeserr@gmail.com> * fix frame flyweights Signed-off-by: Robert Roeser <rroeserr@gmail.com> * testing Signed-off-by: Robert Roeser <rroeserr@gmail.com> * accept ByteBufAllocator in a constructors and renames FrameDecoder to PayloadDecoder Signed-off-by: Robert Roeser <rroeserr@gmail.com> * javadoc Signed-off-by: Robert Roeser <rroeserr@gmail.com> * first pass at refactoring to idomatic ByteBuf flyweights Signed-off-by: Robert Roeser <rroeserr@gmail.com> * fixing tests Signed-off-by: Robert Roeser <rroeserr@gmail.com> * fixed some more tests Signed-off-by: Robert Roeser <rroeserr@gmail.com> * testing Signed-off-by: Robert Roeser <rroeserr@gmail.com> * fix frame flyweights Signed-off-by: Robert Roeser <rroeserr@gmail.com> * accept ByteBufAllocator in a constructors and renames FrameDecoder to PayloadDecoder Signed-off-by: Robert Roeser <rroeserr@gmail.com> * javadoc Signed-off-by: Robert Roeser <rroeserr@gmail.com> * setup frame flyweight: allow null metadata restore micrometer RSocket test Signed-off-by: Maksym Ostroverkhov <m.ostroverkhov@gmail.com> * apply fixes from review release ByteBufs in tests Signed-off-by: Maksym Ostroverkhov <m.ostroverkhov@gmail.com> Signed-off-by: Maksym Ostroverkhov <m.ostroverkhov@gmail.com>
Optimize request channel to let you peak at the first item in the stream #569