public abstract class ExecutorPoweredProcessor<IN,OUT> extends ReactorProcessor<IN,OUT>
Modifier and Type | Field and Description |
---|---|
protected ExecutorService |
executor |
autoCancel, SMALL_BUFFER_SIZE, SUBSCRIBER_COUNT, upstreamSubscription
Modifier | Constructor and Description |
---|---|
protected |
ExecutorPoweredProcessor(String name,
ExecutorService executor,
boolean autoCancel) |
Modifier and Type | Method and Description |
---|---|
boolean |
alive()
Determine whether this
Resource can be used. |
boolean |
awaitAndShutdown()
Block until all submitted tasks have completed, then do a normal
Resource.shutdown() . |
boolean |
awaitAndShutdown(long timeout,
TimeUnit timeUnit)
Block until all submitted tasks have completed, then do a normal
Resource.shutdown() . |
void |
forceShutdown()
Shutdown this
Resource , forcibly halting any work currently executing and discarding any tasks that
have not yet been executed. |
void |
onComplete() |
void |
shutdown()
Shutdown this active
Resource such that it can no longer be used. |
accept, decrementSubscribers, getAvailableCapacity, getCapacity, incrementSubscribers, isReactivePull, onSubscribe
protected final ExecutorService executor
protected ExecutorPoweredProcessor(String name, ExecutorService executor, boolean autoCancel)
public void onComplete()
public boolean awaitAndShutdown()
Resource
Resource.shutdown()
.public boolean awaitAndShutdown(long timeout, TimeUnit timeUnit)
Resource
Resource.shutdown()
.public void forceShutdown()
Resource
Resource
, forcibly halting any work currently executing and discarding any tasks that
have not yet been executed.public boolean alive()
Resource
Resource
can be used.Resource
is alive and can be used, false otherwise.public void shutdown()
Resource
Resource
such that it can no longer be used. If the resource carries any work,
it will wait (but NOT blocking the caller) for all the remaining tasks to perform before closing the resource.Copyright © 2016. All rights reserved.