Interface SdkTaskScheduler
- All Known Implementing Classes:
SdkTaskSchedulerImpl
public interface SdkTaskScheduler
Defines methods used to initiate performing tasks
-
Method Summary
Modifier and TypeMethodDescriptionvoidopen()Opens the SDK task scheduler and starts all the scheduled tasksvoidscheduleAtFixedRate(String name, Runnable command, long initialDelay, long period, TimeUnit unit) Schedules a repeating task.voidShuts down all the scheduled tasksvoidstartOneTimeTask(String name, Runnable command) Creates and executes a one-shot action
-
Method Details
-
open
void open()Opens the SDK task scheduler and starts all the scheduled tasks -
shutdownNow
void shutdownNow()Shuts down all the scheduled tasks -
scheduleAtFixedRate
void scheduleAtFixedRate(String name, Runnable command, long initialDelay, long period, TimeUnit unit) Schedules a repeating task. If the instance is closed, the task will be stored and started only once the instance has been opened withopen()- Parameters:
name- the associated task namecommand- seeScheduledExecutorService.scheduleAtFixedRate(Runnable, long, long, TimeUnit)initialDelay- seeScheduledExecutorService.scheduleAtFixedRate(Runnable, long, long, TimeUnit)period- seeScheduledExecutorService.scheduleAtFixedRate(Runnable, long, long, TimeUnit)unit- seeScheduledExecutorService.scheduleAtFixedRate(Runnable, long, long, TimeUnit)
-
startOneTimeTask
Creates and executes a one-shot action- Parameters:
name- the name of the taskcommand- the task to execute
-