Class SchedulingSystem<T extends org.bukkit.plugin.java.JavaPlugin>

java.lang.Object
io.github.simplexdevelopment.scheduler.SchedulingSystem<T>
All Implemented Interfaces:
ISchedule

public final class SchedulingSystem<T extends org.bukkit.plugin.java.JavaPlugin> extends Object implements ISchedule
  • Field Details

    • serviceManager

      private final ServiceManager serviceManager
    • plugin

      private final T extends org.bukkit.plugin.java.JavaPlugin plugin
    • repeatingPools

      private final Set<ServicePool> repeatingPools
    • mainScheduler

      private final reactor.core.scheduler.Scheduler mainScheduler
  • Constructor Details

    • SchedulingSystem

      public SchedulingSystem(@NotNull @NotNull ServiceManager serviceManager, T plugin)
      Creates a new instance of the scheduling system. This is used to manage the scheduling of services.
      Parameters:
      serviceManager - The service manager to use for this scheduling system.
      plugin - The plugin to use for this scheduling system. This should be an instance of your plugin.
  • Method Details

    • getRepeatingPools

      @Contract(pure=true) public Set<ServicePool> getRepeatingPools()
      Returns:
      A set of ServicePools which contain repeating services.
    • getServiceManager

      @NotNull public @NotNull reactor.core.publisher.Mono<ServiceManager> getServiceManager()
      Specified by:
      getServiceManager in interface ISchedule
      Returns:
      The service manager which exerts control over the service pools and their associated services.
    • queue

      @NotNull public @NotNull reactor.core.publisher.Mono<ServicePool> queue(@NotNull @NotNull IService service)
      Specified by:
      queue in interface ISchedule
      Parameters:
      service - The service to use to locate the associated service pool and queue the service for execution.
      Returns:
      A Mono that can be used to prepare the service for execution within it's associated service pool. If the service has no associated pool, a new pool will be created.
    • runOnce

      @NotNull public @NotNull reactor.core.publisher.Mono<Void> runOnce(IService service)
      Specified by:
      runOnce in interface ISchedule
      Parameters:
      service - The service to run once.
      Returns:
      A Mono object which can be used to run the service one time using Mono.subscribe().
    • forceStop

      public reactor.core.publisher.Mono<Void> forceStop(IService service)
      Specified by:
      forceStop in interface ISchedule
      Parameters:
      service - The service to forcefully stop.
      Returns:
      A Mono object which can be used to forcefully stop the service with Mono.subscribe().
    • forceStart

      public reactor.core.publisher.Mono<Void> forceStart(IService service)
      Specified by:
      forceStart in interface ISchedule
      Parameters:
      service - The service to forcefully start.
      Returns:
      A Mono object which can be used to forcefully start the service with Mono.subscribe().
    • getProvidingPlugin

      @NotNull public @NotNull reactor.core.publisher.Mono<T> getProvidingPlugin()
      Returns:
      A Mono object containing your plugin, for non-blocking communication.
    • getMainSchedulerThread

      @Contract(pure=true) public reactor.core.scheduler.Scheduler getMainSchedulerThread()
      Returns:
      The main thread which the scheduling system operates on.