public abstract class ReactorProcessor<IN,OUT> extends Object implements org.reactivestreams.Processor<IN,OUT>, Consumer<IN>, NonBlocking, Resource
Modifier and Type | Field and Description |
---|---|
protected boolean |
autoCancel |
protected static int |
SMALL_BUFFER_SIZE |
protected static AtomicIntegerFieldUpdater<ReactorProcessor> |
SUBSCRIBER_COUNT |
protected org.reactivestreams.Subscription |
upstreamSubscription |
Constructor and Description |
---|
ReactorProcessor(boolean autoCancel) |
Modifier and Type | Method and Description |
---|---|
void |
accept(IN e)
Execute the logic of the action, accepting the given parameter.
|
protected int |
decrementSubscribers() |
abstract long |
getAvailableCapacity() |
long |
getCapacity()
Return defined element capacity, used to drive new
Subscription
request needs. |
protected boolean |
incrementSubscribers() |
boolean |
isReactivePull(Dispatcher dispatcher,
long producerCapacity)
Get the assigned
Dispatcher . |
void |
onSubscribe(org.reactivestreams.Subscription s) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
alive, awaitAndShutdown, awaitAndShutdown, forceShutdown, shutdown
protected static final int SMALL_BUFFER_SIZE
protected final boolean autoCancel
protected static final AtomicIntegerFieldUpdater<ReactorProcessor> SUBSCRIBER_COUNT
protected org.reactivestreams.Subscription upstreamSubscription
public final void accept(IN e)
Consumer
public void onSubscribe(org.reactivestreams.Subscription s)
onSubscribe
in interface org.reactivestreams.Subscriber<IN>
protected boolean incrementSubscribers()
protected int decrementSubscribers()
public abstract long getAvailableCapacity()
public long getCapacity()
NonBlocking
Subscription
request needs. This is the maximum in-flight data allowed to transit to this elements.getCapacity
in interface NonBlocking
public boolean isReactivePull(Dispatcher dispatcher, long producerCapacity)
NonBlocking
Dispatcher
.isReactivePull
in interface NonBlocking
Copyright © 2016. All rights reserved.