Package org.jabylon.common.progress
Interface ProgressService
-
public interface ProgressServicesimplified version of the ScheduleService meant for one-time tasks- Author:
- jutzig.dev@googlemail.com
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidcancel(String id)attempts to cancel the task with the given idProgressionprogressionOf(String id)retrieves a task currently executed with#schedule(RunnableWithProgress)Stringschedule(RunnableWithProgress task, String description)use this to schedule a one-time taskvoidshutdown()shuts the scheduler/progress service down.
-
-
-
Method Detail
-
schedule
String schedule(RunnableWithProgress task, String description)
use this to schedule a one-time task- Parameters:
task-- Returns:
- the id of the task
-
progressionOf
Progression progressionOf(String id)
retrieves a task currently executed with#schedule(RunnableWithProgress)- Parameters:
id-- Returns:
- the progression of the task
- Throws:
RuntimeException- if the progression cannot be obtained
-
cancel
void cancel(String id)
attempts to cancel the task with the given id- Parameters:
id-
-
shutdown
void shutdown()
shuts the scheduler/progress service down. Tasks will no longer be executed after calling this method. The method is synchronous, so it will wait for the scheduler to be shutdown completely before returning
-
-