Interface Scheduler
public interface Scheduler
Represents a scheduler to execute tasks on the proxy.
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic interface
Represents a fluent interface to schedule tasks on the proxy. -
Method Summary
Modifier and TypeMethodDescriptionInitializes a newScheduler.TaskBuilder
for creating a task on the proxy.buildTask
(@NotNull Object plugin, @NotNull Consumer<ScheduledTask> consumer) Initializes a newScheduler.TaskBuilder
for creating a task on the proxy.@NotNull Collection<ScheduledTask>
tasksByPlugin
(@NotNull Object plugin) Get theScheduledTask
for a specific plugin.
-
Method Details
-
buildTask
Scheduler.TaskBuilder buildTask(@NotNull @NotNull Object plugin, @NotNull @NotNull Runnable runnable) Initializes a newScheduler.TaskBuilder
for creating a task on the proxy.- Parameters:
plugin
- the plugin to request the task forrunnable
- the task to run when scheduled- Returns:
- the task builder
-
buildTask
Scheduler.TaskBuilder buildTask(@NotNull @NotNull Object plugin, @NotNull @NotNull Consumer<ScheduledTask> consumer) Initializes a newScheduler.TaskBuilder
for creating a task on the proxy.- Parameters:
plugin
- the plugin to request the task forconsumer
- the task to be run when scheduled with the capacity to cancel itself- Returns:
- the task builder
-
tasksByPlugin
Get theScheduledTask
for a specific plugin.- Parameters:
plugin
- the plugin object- Returns:
- the list of
ScheduledTask
corresponding to a specific plugin
-