Class BlockingTaskQueue.Builder

  • Enclosing class:
    BlockingTaskQueue

    public static class BlockingTaskQueue.Builder
    extends java.lang.Object
    • Constructor Detail

      • Builder

        public Builder()
    • Method Detail

      • executor

        public BlockingTaskQueue.Builder executor​(java.util.concurrent.ExecutorService executor)
        Provides the executor service that all user tasks will be executed on.
      • scheduler

        public 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.
      • infiniteTimeout

        public BlockingTaskQueue.Builder infiniteTimeout()
        Sets the timeout to zero, which disables the timeout system.
      • timeout

        public 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 a TaskTimedOutException
      • maxQueueLength

        public 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.