Adds specific requestChannel(Payload, Publisher<Payload>) #572
Adds specific requestChannel(Payload, Publisher<Payload>) #572robertroeser merged 4 commits into1.0.xrsocket/rsocket-java:1.0.xfrom requestChannelImprovementsrsocket/rsocket-java:requestChannelImprovementsCopy head branch name to clipboard
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.
| * 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.
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.
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.
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