Interface TaskBuilder
public interface TaskBuilder
Functional builder providing chained access to the functionality in
Scheduler;-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interfaceThe next builder in the task chain, which already has a defined delay context.static interfacestatic interfacestatic interfaceThe next builder in the task chain, which already has a defined task context. -
Method Summary
Modifier and TypeMethodDescriptionasync()Marks that the new task should run async, and returns the next builder in the chain.static @NotNull TaskBuilderGets a task builder instancedefault TaskBuilder.ThreadContextualon(@NotNull ThreadContext context) Defines the thread context of the new task, and returns the next builder in the chain.sync()Marks that the new task should run sync, and returns the next builder in the chain.
-
Method Details
-
newBuilder
Gets a task builder instance- Returns:
- a task builder instance
-
on
Defines the thread context of the new task, and returns the next builder in the chain.- Parameters:
context- the context to run the task in- Returns:
- a contextual builder
-
sync
Marks that the new task should run sync, and returns the next builder in the chain.- Returns:
- a "sync" contextual builder
-
async
Marks that the new task should run async, and returns the next builder in the chain.- Returns:
- an "async" contextual builder
-