Top Description Inners Fields Constructors Methods
org.springframework.messaging.handler.invocation.reactive

pack-priv Class ChannelSendOperator<T>

extends Mono<Void>
implements Scannable
Class Inheritance
All Implemented Interfaces
reactor.core.Scannable
Type Parameters
<T>
the type of element signaled
Imports
java.util.function.Function, org.reactivestreams.Publisher, .Subscriber, .Subscription, reactor.core.CoreSubscriber, .Scannable, reactor.core.publisher.Flux, .Mono, .Operators, reactor.util.context.Context, org.springframework.core.io.buffer.DataBuffer, .DataBufferUtils, org.springframework.lang.Nullable, org.springframework.util.Assert

----------------------

Note

This class was copied from org.springframework.http.server.reactive.ChannelSendOperator and is identical to it. It's used for the same purpose, i.e. the ability to switch to alternate handling via annotated exception handler methods if the output publisher starts with an error.

----------------------

Given a write function that accepts a source Publisher<T> to write with and returns Publisher<Void> for the result, this operator helps to defer the invocation of the write function, until we know if the source publisher will begin publishing without an error. If the first emission is an error, the write function is bypassed, and the error is sent directly through the result publisher. Otherwise the write function is invoked.

Authors
Rossen Stoyanchev, Stephane Maldini
Since
5.2

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static enum
private class
ChannelSendOperator.WriteBarrier

A barrier inserted between the write source and the write subscriber (i.e. the HTTP server adapter) that pre-fetches and waits for the first signal before deciding whether to hook in to the write subscriber.

private class
ChannelSendOperator.WriteCompletionBarrier

We need an extra barrier between the WriteBarrier itself and the actual completion subscriber.

Field Summary

Modifier and TypeField and Description
private final Flux<T>
private final Function<Publisher<T>, Publisher<Void>>

Constructor Summary

AccessConstructor and Description
public
ChannelSendOperator(Publisher<? extends T> source, Function<Publisher<T>, Publisher<Void>> writeFunction)

Method Summary

Modifier and TypeMethod and Description
public Object
scanUnsafe(Scannable.Attr<T>
a Attr to resolve for the component.
key
)

Implements reactor.core.Scannable.scanUnsafe.

This method is used internally by components to define their key-value mappings in a single place.

public void
subscribe(CoreSubscriber<? super Void>
the Subscriber interested into the published sequence
actual
)

Implements abstract reactor.core.publisher.Mono.subscribe.

Implements reactor.core.CorePublisher.subscribe.

An internal Publisher#subscribe(Subscriber) that will bypass Hooks#onLastOperator(Function) pointcut.

Inherited from reactor.core.publisher.Mono:
andasblockblockblockOptionalblockOptionalcachecachecachecachecachecacheInvalidateIfcacheInvalidateWhencacheInvalidateWhencancelOncastcheckpointcheckpointcheckpointconcatWithcontextCapturecontextWritecontextWritecreatedefaultIfEmptydeferdeferContextualdelaydelaydelayElementdelayElementdelaySubscriptiondelaySubscriptiondelaySubscriptiondelayUntildematerializedoAfterTerminatedoFinallydoFirstdoOnCanceldoOnDiscarddoOnEachdoOnErrordoOnErrordoOnErrordoOnNextdoOnRequestdoOnSubscribedoOnSuccessdoOnTerminateelapsedelapsedemptyerrorerrorexpandexpandexpandDeepexpandDeepfilterfilterWhenfirstfirstfirstWithSignalfirstWithSignalfirstWithValuefirstWithValueflatMapflatMapIterableflatMapManyflatMapManyfluxfromfromCallablefromCompletionStagefromCompletionStagefromDirectfromFuturefromFuturefromFuturefromFuturefromRunnablefromSupplierhandlehasElementhideignoreElementignoreElementsjustjustOrEmptyjustOrEmptyloglogloglogloglogmapmapNotNullmaterializemergeWithmetricsnameneverofTypeonAssemblyonErrorCompleteonErrorCompleteonErrorCompleteonErrorContinueonErrorContinueonErrorContinueonErrorMaponErrorMaponErrorMaponErrorResumeonErrorResumeonErrorResumeonErrorReturnonErrorReturnonErrorReturnonErrorStoponTerminateDetachorpublishpublishOnrepeatrepeatrepeatrepeatrepeatWhenrepeatWhenEmptyrepeatWhenEmptyretryretryretryWhensequenceEqualsequenceEqualsequenceEqualsharesinglesingleOptionalsubscribesubscribesubscribesubscribesubscribesubscribesubscribesubscribeOnsubscribeWithswitchIfEmptytagtaketaketakeUntilOthertaptaptapthenthenthenEmptythenManythenReturntimedtimedtimeouttimeouttimeouttimeouttimeouttimeouttimestamptimestamptoFuturetoStringtransformtransformDeferredtransformDeferredContextualusingusingusingWhenusingWhenwhenwhenwhenDelayErrorwhenDelayErrorzipzipzipzipzipzipzipzipzipzipzipDelayErrorzipDelayErrorzipDelayErrorzipDelayErrorzipDelayErrorzipDelayErrorzipDelayErrorzipDelayErrorzipDelayErrorzipWhenzipWhenzipWithzipWith