Class SchedulingSystem<T extends org.bukkit.plugin.java.JavaPlugin>
java.lang.Object
io.github.simplexdevelopment.scheduler.SchedulingSystem<T>
- All Implemented Interfaces:
ISchedule
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) static intA denominator to use when registering default service pool names.private final ReactorBukkitSchedulerThe main scheduler which this system runs on.private final TThe plugin to use for registering tasks.private final ServiceManagerThe service manager to use for controlling service pools. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionreactor.core.publisher.Mono<Void>forceStart(IService service) reactor.core.publisher.Mono<Void>@NotNull reactor.core.publisher.Mono<T>@NotNull reactor.core.publisher.Mono<ServiceManager>@NotNull reactor.core.publisher.Mono<reactor.core.Disposable>Queues a service to be executed in a service pool.@NotNull reactor.core.publisher.Mono<Void>
-
Field Details
-
denom
static int denomA denominator to use when registering default service pool names. -
serviceManager
The service manager to use for controlling service pools. -
plugin
The plugin to use for registering tasks. This should be an instance of your plugin. -
mainScheduler
The main scheduler which this system runs on. This is an abstraction of theBukkitScheduler, and as a result runs on the Main server thread.
-
-
Constructor Details
-
SchedulingSystem
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
- Specified by:
getServiceManagerin interfaceISchedule- 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:IScheduleQueues a service to be executed in a service pool. -
runOnce
-
forceStop
-
forceStart
- Specified by:
forceStartin interfaceISchedule- Parameters:
service- The service to forcefully start.- Returns:
- A Mono
object which can be used to forcefully start the service with Mono.subscribe().
-
getProvidingPlugin
- Returns:
- A Mono object containing your plugin, for non-blocking communication.
-
getMainScheduler
- Returns:
- The main thread which the scheduling system operates on.
-