Browse Source

Update Javadoc of reactive WebSocketHandler

Replace suggestion to use zip with and operator.

Closes gh-35572
pull/35629/head
rstoyanchev 2 months ago
parent
commit
c165dd5e0e
  1. 4
      framework-docs/modules/ROOT/pages/web/webflux-websocket.adoc
  2. 4
      spring-webflux/src/main/java/org/springframework/web/reactive/socket/WebSocketHandler.java

4
framework-docs/modules/ROOT/pages/web/webflux-websocket.adoc

@ -310,7 +310,7 @@ Java:: @@ -310,7 +310,7 @@ Java::
Flux<String> source = ... ;
Mono<Void> output = session.send(source.map(session::textMessage)); <2>
return Mono.zip(input, output).then(); <3>
return input.and(output); <3>
}
}
----
@ -338,7 +338,7 @@ Kotlin:: @@ -338,7 +338,7 @@ Kotlin::
val source: Flux<String> = ...
val output = session.send(source.map(session::textMessage)) // <2>
return Mono.zip(input, output).then() // <3>
return input.and(output) // <3>
}
}
----

4
spring-webflux/src/main/java/org/springframework/web/reactive/socket/WebSocketHandler.java

@ -63,7 +63,7 @@ import reactor.core.publisher.Mono; @@ -63,7 +63,7 @@ import reactor.core.publisher.Mono;
* </pre>
*
* <p>If processing inbound and sending outbound messages are independent
* streams, they can be joined together with the "zip" operator:
* streams, they can be joined together with the "and" operator:
*
* <pre class="code">
* class ExampleHandler implements WebSocketHandler {
@ -83,7 +83,7 @@ import reactor.core.publisher.Mono; @@ -83,7 +83,7 @@ import reactor.core.publisher.Mono;
* Flux&lt;String&gt; source = ... ;
* Mono&lt;Void&gt; output = session.send(source.map(session::textMessage));
*
* return Mono.zip(input, output).then();
* return input.and(output);
* }
* }
* </pre>

Loading…
Cancel
Save