Class AbstractQueueScheduler

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void add​(Request r)
      Adds a request to the queue.
      void add​(Request r, Handler h)
      Adds a request to the queue.
      void add​(Request r, Handler h, Priority p)
      Adds a request to the queue.
      void add​(Request r, Priority p)
      Adds a request to the queue.
      void add​(Request r, Priority p, Priority pf)
      Adds a request to the queue.
      int drainTo​(java.util.Collection<? super Job> c)  
      int drainTo​(java.util.Collection<? super Job> c, int maxElements)  
      java.util.Iterator<Job> iterator()  
      boolean offer​(Job job)  
      Job peek()  
      int remainingCapacity()  
      int size()  
      Job take()  
      • Methods inherited from class java.util.AbstractQueue

        add, addAll, clear, element, remove
      • Methods inherited from class java.util.AbstractCollection

        contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray, toString
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
      • Methods inherited from interface java.util.concurrent.BlockingQueue

        add, contains, offer, poll, put, remove
      • Methods inherited from interface java.util.Collection

        addAll, clear, containsAll, equals, hashCode, isEmpty, parallelStream, removeAll, removeIf, retainAll, spliterator, stream, toArray, toArray, toArray
      • Methods inherited from interface java.lang.Iterable

        forEach
      • Methods inherited from interface java.util.Queue

        element, poll, remove
      • Methods inherited from interface ai.preferred.venom.job.Scheduler

        add
    • Constructor Detail

      • AbstractQueueScheduler

        public AbstractQueueScheduler()
    • Method Detail

      • add

        public final void add​(Request r,
                              Handler h,
                              Priority p)
        Description copied from interface: Scheduler
        Adds a request to the queue.

        This request would be parsed by the handler specified, and its priority can be downgraded to the default minimum priority.

        Specified by:
        add in interface Scheduler
        Parameters:
        r - request to fetch when dequeued
        h - handler to be used to parse the request
        p - initial priority of the request
      • add

        public final void add​(Request r,
                              Handler h)
        Description copied from interface: Scheduler
        Adds a request to the queue.

        This request would be parsed by the handler specified, and it's initialised with default priority that can be downgraded to the default minimum priority.

        Specified by:
        add in interface Scheduler
        Parameters:
        r - request to fetch when dequeued
        h - handler to be used to parse the request
      • add

        public final void add​(Request r,
                              Priority p,
                              Priority pf)
        Description copied from interface: Scheduler
        Adds a request to the queue.

        This request would be parsed by a handler defined in Router or otherwise, and its priority can be downgraded to a minimum priority specified.

        Specified by:
        add in interface Scheduler
        Parameters:
        r - request to fetch when dequeued
        p - initial priority of the request
        pf - the minimum (floor) priority of this request
      • add

        public final void add​(Request r,
                              Priority p)
        Description copied from interface: Scheduler
        Adds a request to the queue.

        This request would be parsed by a handler defined in Router or otherwise defined, and its priority can be downgraded to the default minimum priority.

        Specified by:
        add in interface Scheduler
        Parameters:
        r - request to fetch when dequeued
        p - initial priority of the request
      • add

        public final void add​(Request r)
        Description copied from interface: Scheduler
        Adds a request to the queue.

        This request would be parsed by a handler defined in Router or otherwise defined, and it's initialised with default priority that can be downgraded to the default minimum priority.

        Specified by:
        add in interface Scheduler
        Parameters:
        r - request to fetch when dequeued
      • iterator

        @Nonnull
        public final java.util.Iterator<Job> iterator()
        Specified by:
        iterator in interface java.util.Collection<Job>
        Specified by:
        iterator in interface java.lang.Iterable<Job>
        Specified by:
        iterator in class java.util.AbstractCollection<Job>
      • size

        public final int size()
        Specified by:
        size in interface java.util.Collection<Job>
        Specified by:
        size in class java.util.AbstractCollection<Job>
      • take

        @Nonnull
        public final Job take()
                       throws java.lang.InterruptedException
        Specified by:
        take in interface java.util.concurrent.BlockingQueue<Job>
        Throws:
        java.lang.InterruptedException
      • remainingCapacity

        public final int remainingCapacity()
        Specified by:
        remainingCapacity in interface java.util.concurrent.BlockingQueue<Job>
      • drainTo

        public final int drainTo​(@Nonnull
                                 java.util.Collection<? super Job> c)
        Specified by:
        drainTo in interface java.util.concurrent.BlockingQueue<Job>
      • drainTo

        public final int drainTo​(@Nonnull
                                 java.util.Collection<? super Job> c,
                                 int maxElements)
        Specified by:
        drainTo in interface java.util.concurrent.BlockingQueue<Job>
      • offer

        public final boolean offer​(@Nonnull
                                   Job job)
        Specified by:
        offer in interface java.util.concurrent.BlockingQueue<Job>
        Specified by:
        offer in interface java.util.Queue<Job>
      • peek

        public final Job peek()
        Specified by:
        peek in interface java.util.Queue<Job>