Java Code Examples for reactor.core.publisher.Flux#switchOnFirst()
The following examples show how to use
reactor.core.publisher.Flux#switchOnFirst() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: RSocketBrokerResponderHandler.java From alibaba-rsocket-broker with Apache License 2.0 | 5 votes |
@Override @NotNull public Flux<Payload> requestChannel(@NotNull Publisher<Payload> payloads) { if (payloads instanceof Flux) { Flux<Payload> payloadsWithSignalRouting = (Flux<Payload>) payloads; return payloadsWithSignalRouting.switchOnFirst((signal, flux) -> requestChannel(signal.get(), flux.skip(1))); } return Flux.error(new InvalidException(RsocketErrorCode.message("RST-201400"))); }
Example 2
Source File: UpstreamForwardRSocket.java From alibaba-rsocket-broker with Apache License 2.0 | 5 votes |
@Override public @NotNull Flux<Payload> requestChannel(@NotNull Publisher<Payload> payloads) { if (payloads instanceof Flux) { Flux<Payload> payloadsWithSignalRouting = (Flux<Payload>) payloads; //noinspection ConstantConditions return payloadsWithSignalRouting.switchOnFirst((signal, flux) -> requestChannel(signal.get(), flux.skip(1))); } return Flux.error(new InvalidException(RsocketErrorCode.message("RST-201400"))); }
Example 3
Source File: RSocketResponderHandler.java From alibaba-rsocket-broker with Apache License 2.0 | 5 votes |
@SuppressWarnings("ConstantConditions") @Override @NotNull public final Flux<Payload> requestChannel(@NotNull Publisher<Payload> payloads) { if (payloads instanceof Flux) { Flux<Payload> payloadsWithSignalRouting = (Flux<Payload>) payloads; return payloadsWithSignalRouting.switchOnFirst((signal, flux) -> requestChannel(signal.get(), flux.skip(1))); } return Flux.error(new InvalidException(RsocketErrorCode.message("RST-201400"))); }