Class FlowSupport
java.lang.Object
com.github.mizosoft.methanol.internal.flow.FlowSupport
Helpers for implementing reactive streams subscriptions and the like.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Flow.SubscriptionA subscription that does nothing.static final ExecutorAn executor that executes the runnable in the calling thread. -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> Flow.Publisher<T> static longgetAndAddDemand(Object owner, VarHandle demand, long n) Adds the given count to demand, making sure it doesn't exceedLong.MAX_VALUE.static voidonDroppedException(Throwable exception) static intprefetch()Returns the prefetch property or a default of 8.static intReturns the prefetch threshold according to the prefetch factor property or a default of 8/ 2.static voidreject(Flow.Subscriber<?> subscriber, Throwable cause) static voidrejectMulticast(Flow.Subscriber<?> subscriber) static longsubtractAndGetDemand(Object owner, VarHandle demand, long n) Subtracts given count from demand.
-
Field Details
-
NOOP_SUBSCRIPTION
A subscription that does nothing. -
SYNC_EXECUTOR
An executor that executes the runnable in the calling thread.
-
-
Method Details
-
prefetch
public static int prefetch()Returns the prefetch property or a default of 8. -
prefetchThreshold
public static int prefetchThreshold()Returns the prefetch threshold according to the prefetch factor property or a default of 8/ 2. -
getAndAddDemand
-
subtractAndGetDemand
-
emptyPublisher
-
rejectMulticast
-
reject
-
onDroppedException
-