Class JobScheduler

  • All Implemented Interfaces:
    Scheduler

    public class JobScheduler
    extends java.lang.Object
    implements Scheduler
    An implementation of ai.preferred.venom.job.Scheduler using Job.
    • Constructor Detail

      • JobScheduler

        public JobScheduler​(QueueScheduler queueScheduler)
        Constructs an instance of JobScheduler.
        Parameters:
        queueScheduler - an instance of BlockingQueue
    • Method Detail

      • add

        public final void add​(@NotNull
                              @NotNull Request request,
                              Handler handler,
                              @NotNull
                              @NotNull JobAttribute... jobAttributes)
        Description copied from interface: Scheduler
        Adds a request to the queue.

        This request would be parsed by the handler specified.

        Specified by:
        add in interface Scheduler
        Parameters:
        request - request to fetch when dequeued.
        handler - handler to be used to parse the request.
        jobAttributes - attributes to insert to the job.
      • add

        public final void add​(@NotNull
                              @NotNull Request request,
                              @NotNull
                              @NotNull JobAttribute... jobAttributes)
        Description copied from interface: Scheduler
        Adds a request to the queue.

        This request would be parsed by the handler specified.

        Specified by:
        add in interface Scheduler
        Parameters:
        request - request to fetch when dequeued.
        jobAttributes - attributes to insert to the job.
      • add

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

        This request would be parsed by the handler specified.

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

        public final void add​(@NotNull
                              @NotNull Request request)
        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.

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

        public final void add​(@NotNull
                              @NotNull Request r,
                              Handler h,
                              Priority p,
                              Priority pf)
        Description copied from interface: Scheduler
        Adds a request to the queue. Will be removed in the next release.

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

        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
        pf - the minimum (floor) priority of this request
      • add

        public final void add​(@NotNull
                              @NotNull Request r,
                              Handler h,
                              Priority p)
        Description copied from interface: Scheduler
        Adds a request to the queue. Will be removed in the next release.

        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​(@NotNull
                              @NotNull Request r,
                              Priority p,
                              Priority pf)
        Description copied from interface: Scheduler
        Adds a request to the queue. Will be removed in the next release.

        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​(@NotNull
                              @NotNull Request r,
                              Priority p)
        Description copied from interface: Scheduler
        Adds a request to the queue. Will be removed in the next release.

        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