Class BlockingTaskQueue.Builder
java.lang.Object
com.inductiveautomation.perspective.gateway.threading.BlockingTaskQueue.Builder
- Enclosing class:
- BlockingTaskQueue
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbuild()
executor
(ExecutorService executor) Provides the executor service that all user tasks will be executed on.Shortcut formaxQueueLength(int)
of zero.Sets the timeout to zero, which disables the timeout system.maxQueueLength
(int queueLength) scheduler
(ScheduledExecutorService scheduler) Sets the timeout scheduler using a scheduled executor service.scheduler
(org.python.netty.util.HashedWheelTimer wheel) Sets the timeout scheduler to a wheel timer, which is more efficient than a scheduled executor service.shutdownBehavior
(BlockingTaskQueue.ShutdownBehavior shutdownBehavior) Configures the shutdown behavior.Sets the timeout, after which elapsed time an executing task will be cancelled, and its completion stage will be completed with aTaskTimedOutException
-
Constructor Details
-
Builder
public Builder()
-
-
Method Details
-
executor
Provides the executor service that all user tasks will be executed on. -
scheduler
Sets the timeout scheduler using a scheduled executor service. It is recommened that you usescheduler(HashedWheelTimer)
instead. -
scheduler
Sets the timeout scheduler to a wheel timer, which is more efficient than a scheduled executor service. -
infiniteTimeout
Sets the timeout to zero, which disables the timeout system. -
timeout
Sets the timeout, after which elapsed time an executing task will be cancelled, and its completion stage will be completed with aTaskTimedOutException
-
infiniteQueue
Shortcut formaxQueueLength(int)
of zero. -
maxQueueLength
- Parameters:
queueLength
- Maximum pending tasks allowed to be in the queue. If the queue is at this size, and an additional task is added, the oldest task in the queue will be rejected to make room for the new one. If this value is non-positive, the queue will be infinite.
-
shutdownBehavior
public BlockingTaskQueue.Builder shutdownBehavior(BlockingTaskQueue.ShutdownBehavior shutdownBehavior) Configures the shutdown behavior. Default is CANCEL_PENDING -
build
-