File tree Expand file tree Collapse file tree 2 files changed +11
-6
lines changed Expand file tree Collapse file tree 2 files changed +11
-6
lines changed Original file line number Diff line number Diff line change 41
41
import reactor .core .publisher .Mono ;
42
42
import reactor .core .publisher .SignalType ;
43
43
import reactor .core .publisher .UnicastProcessor ;
44
- import reactor .util .concurrent .Queues ;
45
44
46
45
/** Client Side of a RSocket socket. Sends {@link ByteBuf}s to a {@link RSocketServer} */
47
46
class RSocketClient implements RSocket {
@@ -226,8 +225,7 @@ private Flux<Payload> handleRequestStream(final Payload payload) {
226
225
int streamId = streamIdSupplier .nextStreamId ();
227
226
228
227
final UnboundedProcessor <ByteBuf > sendProcessor = this .sendProcessor ;
229
- final UnicastProcessor <Payload > receiver =
230
- UnicastProcessor .create (Queues .<Payload >one ().get ());
228
+ final UnicastProcessor <Payload > receiver = UnicastProcessor .create ();
231
229
232
230
receivers .put (streamId , receiver );
233
231
@@ -277,8 +275,7 @@ private Flux<Payload> handleChannel(Flux<Payload> request) {
277
275
return lifecycle .activeFlux (
278
276
() -> {
279
277
final UnboundedProcessor <ByteBuf > sendProcessor = this .sendProcessor ;
280
- final UnicastProcessor <Payload > receiver =
281
- UnicastProcessor .create (Queues .<Payload >one ().get ());
278
+ final UnicastProcessor <Payload > receiver = UnicastProcessor .create ();
282
279
final int streamId = streamIdSupplier .nextStreamId ();
283
280
284
281
return receiver
Original file line number Diff line number Diff line change @@ -84,6 +84,12 @@ public Mono<Payload> requestResponse(Payload payload) {
84
84
rule .assertServerError ("java.lang.NullPointerException: Deliberate exception." );
85
85
}
86
86
87
+ @ Test (timeout = 2000 )
88
+ public void testStream () throws Exception {
89
+ Flux <Payload > responses = rule .crs .requestStream (DefaultPayload .create ("Payload In" ));
90
+ StepVerifier .create (responses ).expectNextCount (10 ).expectComplete ().verify ();
91
+ }
92
+
87
93
@ Test (timeout = 2000 )
88
94
public void testChannel () throws Exception {
89
95
Flux <Payload > requests =
@@ -136,7 +142,9 @@ public Mono<Payload> requestResponse(Payload payload) {
136
142
137
143
@ Override
138
144
public Flux <Payload > requestStream (Payload payload ) {
139
- return Flux .never ();
145
+ return Flux .range (1 , 10 )
146
+ .map (
147
+ i -> DefaultPayload .create ("server got -> [" + payload .toString () + "]" ));
140
148
}
141
149
142
150
@ Override
You can’t perform that action at this time.
0 commit comments