Class BlockingTaskQueue.Builder
- java.lang.Object
- 
- com.inductiveautomation.perspective.gateway.threading.BlockingTaskQueue.Builder
 
- 
- Enclosing class:
- BlockingTaskQueue
 
 public static class BlockingTaskQueue.Builder extends java.lang.Object
- 
- 
Constructor SummaryConstructors Constructor Description Builder()
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description BlockingTaskQueuebuild()BlockingTaskQueue.Builderexecutor(java.util.concurrent.ExecutorService executor)Provides the executor service that all user tasks will be executed on.BlockingTaskQueue.BuilderinfiniteQueue()Shortcut formaxQueueLength(int)of zero.BlockingTaskQueue.BuilderinfiniteTimeout()Sets the timeout to zero, which disables the timeout system.BlockingTaskQueue.BuildermaxQueueLength(int queueLength)BlockingTaskQueue.Builderscheduler(java.util.concurrent.ScheduledExecutorService scheduler)Sets the timeout scheduler using a scheduled executor service.BlockingTaskQueue.Builderscheduler(org.python.netty.util.HashedWheelTimer wheel)Sets the timeout scheduler to a wheel timer, which is more efficient than a scheduled executor service.BlockingTaskQueue.BuildershutdownBehavior(BlockingTaskQueue.ShutdownBehavior shutdownBehavior)Configures the shutdown behavior.BlockingTaskQueue.Buildertimeout(long timeout, java.util.concurrent.TimeUnit unit)Sets the timeout, after which elapsed time an executing task will be cancelled, and its completion stage will be completed with aTaskTimedOutException
 
- 
- 
- 
Method Detail- 
executorpublic BlockingTaskQueue.Builder executor(java.util.concurrent.ExecutorService executor) Provides the executor service that all user tasks will be executed on.
 - 
schedulerpublic BlockingTaskQueue.Builder scheduler(java.util.concurrent.ScheduledExecutorService scheduler) Sets the timeout scheduler using a scheduled executor service. It is recommened that you usescheduler(HashedWheelTimer)instead.
 - 
schedulerpublic BlockingTaskQueue.Builder scheduler(org.python.netty.util.HashedWheelTimer wheel) Sets the timeout scheduler to a wheel timer, which is more efficient than a scheduled executor service.
 - 
infiniteTimeoutpublic BlockingTaskQueue.Builder infiniteTimeout() Sets the timeout to zero, which disables the timeout system.
 - 
timeoutpublic BlockingTaskQueue.Builder timeout(long timeout, java.util.concurrent.TimeUnit unit) Sets the timeout, after which elapsed time an executing task will be cancelled, and its completion stage will be completed with aTaskTimedOutException
 - 
infiniteQueuepublic BlockingTaskQueue.Builder infiniteQueue() Shortcut formaxQueueLength(int)of zero.
 - 
maxQueueLengthpublic BlockingTaskQueue.Builder maxQueueLength(int queueLength) - 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.
 
 - 
shutdownBehaviorpublic BlockingTaskQueue.Builder shutdownBehavior(BlockingTaskQueue.ShutdownBehavior shutdownBehavior) Configures the shutdown behavior. Default is CANCEL_PENDING
 - 
buildpublic BlockingTaskQueue build() 
 
- 
 
-