Package org.pepstock.charba.client.utils
Class CScheduler
- java.lang.Object
-
- org.pepstock.charba.client.utils.CScheduler
-
public final class CScheduler extends Object
This class provides asynchronous and delayed task scheduling, based setTimeout java script method.- Author:
- Andrea "Stock" Stocchero
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static CScheduler
get()
Returns the instance of singleton.CSchedulerRegistration
submit(Runnable task)
Schedules immediately a task, without any delay.CSchedulerRegistration
submit(Runnable task, int delay)
Schedules a task with a constant delay.
-
-
-
Method Detail
-
get
public static CScheduler get()
Returns the instance of singleton.- Returns:
- the instance of singleton
-
submit
public CSchedulerRegistration submit(Runnable task)
Schedules immediately a task, without any delay.- Parameters:
task
- the command to execute- Returns:
- the task scheduling registration for canceling, if needed
-
submit
public CSchedulerRegistration submit(Runnable task, int delay)
Schedules a task with a constant delay.- Parameters:
task
- the command to executedelay
- the amount of time to wait after one invocation ends before the next invocation- Returns:
- the task scheduling registration for canceling, if needed
-
-