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
  • Constructor Details

    • SchedulingSystem

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

    • 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<reactor.core.Disposable> queue(@NotNull @NotNull IService service)
      Description copied from interface: ISchedule
      Queues a service to be executed in a service pool.
      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 object that can be used to cancel the service.
    • 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.
    • getMainScheduler

      @Contract(pure=true) public ReactorBukkitScheduler getMainScheduler()
      Returns:
      The main thread which the scheduling system operates on.