public final class DistributedTaskManager extends Object implements TaskManager
| Constructor and Description |
|---|
DistributedTaskManager() |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
String |
createTask(String taskClassName,
String createdBy,
java.time.Instant runAt,
long period,
mjson.Json configuration)
Schedule a single shot/one off BackgroundTask to run after a @delay in milliseconds.
|
TaskManager |
stopTask(String id,
String requesterName)
Stop a Scheduled, Paused or Running task.
|
TaskStateStorage |
storage()
Return the StateStorage instance that is used by this class.
|
public void close()
close in interface AutoCloseablepublic String createTask(String taskClassName, String createdBy, java.time.Instant runAt, long period, mjson.Json configuration)
TaskManagercreateTask in interface TaskManagertaskClassName - Name of the class implementing the BackgroundTask interface that is to be scheduled for later execution.runAt - Instant when task should run.period - A non-zero value indicates that this should be a recurring task and period indicates the delay between
subsequent runs of the task after successful execution.configuration - A JSONObject instance containing configuration and optionally data for the task. This is an
optional parameter and may be set to null to not pass any configuration (task.start() will
get an initialised but empty JSONObject).public TaskManager stopTask(String id, String requesterName)
TaskManagerstopTask in interface TaskManagerid - String of task to stop.requesterName - Optional String to denote who requested this call; used for status reporting and may be null.public TaskStateStorage storage()
TaskManagerstorage in interface TaskManagerCopyright © 2017 Grakn Labs Ltd. All rights reserved.