Interface Fuseable
- All Known Implementing Classes:
Operators.MonoSubscriber,ReplayProcessor,UnicastProcessor
Fuseable.QueueSubscription.-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceA subscriber variant that can immediately tell if it consumed the value or not, directly allowing a new value to be sent if it didn't.static interfaceSupport contract for queue-fusion based optimizations on subscriptions.static interfaceMarker interface indicating that the target can return a value or null, otherwise fail immediately and thus a viable target for assembly-time optimizations.static interfaceBase class for synchronous sources which have fixed size and can emit their items in a pull fashion, thus avoiding the request-accounting overhead in many cases. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intIndicates the QueueSubscription should decide what fusion it performs (input only).static final intIndicates the QueueSubscription can perform only async-fusion.static final intIndicates the QueueSubscription can't support the requested mode.static final intIndicates the QueueSubscription can perform sync-fusion.static final intIndicates that the queue will be drained from another thread thus any queue-exit computation may be invalid at that point. -
Method Summary
Static MethodsModifier and TypeMethodDescriptionstatic StringfusionModeName(int mode) Attempt to convert a fusion mode int code into a human-readable representation.static StringfusionModeName(int mode, boolean ignoreThreadBarrier) Attempt to convert a fusion mode int code into a human-readable representation.
-
Field Details
-
NONE
static final int NONEIndicates the QueueSubscription can't support the requested mode.- See Also:
-
SYNC
static final int SYNCIndicates the QueueSubscription can perform sync-fusion.- See Also:
-
ASYNC
static final int ASYNCIndicates the QueueSubscription can perform only async-fusion.- See Also:
-
ANY
static final int ANYIndicates the QueueSubscription should decide what fusion it performs (input only).- See Also:
-
THREAD_BARRIER
static final int THREAD_BARRIERIndicates that the queue will be drained from another thread thus any queue-exit computation may be invalid at that point.For example, an
asyncSource.map().publishOn().subscribe()sequence whereasyncSourceis async-fuseable: publishOn may fuse the whole sequence into a single Queue. That in turn could invoke the mapper function from itspoll()method from another thread, whereas the unfused sequence would have invoked the mapper on the previous thread. If such mapper invocation is costly, it would escape its thread boundary this way.- See Also:
-
-
Method Details
-
fusionModeName
Attempt to convert a fusion mode int code into a human-readable representation. Note that this can include theTHREAD_BARRIERflag, as an appended+THREAD_BARRIER.This method accepts
-1as a special code, mainly for the benefit of supporting testing scenarios where fusion can be entirely deactivated (returnsDisabled). Other negative values and unknown positive codes on the other hand returnUnknown(x).Note that as this is a human-facing representation, the different values could evolve in the future. As such, never compare the returned string to a constant, but always use this method on both sides of a comparison.
- Parameters:
mode- the fusion mode int code- Returns:
- a human-readable
Stringrepresentation of the code
-
fusionModeName
Attempt to convert a fusion mode int code into a human-readable representation. Note that this can include theTHREAD_BARRIERflag, as an appended+THREAD_BARRIER, unless theignoreThreadBarrierparameter is set to true.This method accepts
-1as a special code, mainly for the benefit of supporting testing scenarios where fusion can be entirely deactivated (returnsDisabled). Other negative values and unknown positive codes on the other hand returnUnknown(x).Note that as this is a human-facing representation, the different values could evolve in the future. As such, never compare the returned string to a constant, but always use this method on both sides of a comparison.
- Parameters:
mode- the fusion mode int codeignoreThreadBarrier- whether or not to ignore theTHREAD_BARRIERflag in the representation- Returns:
- a human-readable
Stringrepresentation of the code
-