public class TaskManagerCommandScope extends Object implements Scope
BackgroundTaskManager
. Scope handles scheduling and
start/end notifications for individual builds, passing tasks/notifications to the manager for
scheduling.
This lives for the duration of the command, and will schedule the tasks to be run on close()
. close()
should only occur on command exit.
Modifier | Constructor and Description |
---|---|
protected |
TaskManagerCommandScope(BackgroundTaskManager manager,
BuildId buildId,
boolean blocking) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
BackgroundTaskManager |
getManager() |
void |
schedule(BackgroundTask<?> task)
Schedule a task to be run by a
BackgroundTaskManager . |
void |
schedule(com.google.common.collect.ImmutableList<? extends BackgroundTask<?>> taskList)
Schedule a list of tasks to be run by a
BackgroundTaskManager . |
protected TaskManagerCommandScope(BackgroundTaskManager manager, BuildId buildId, boolean blocking)
public void schedule(BackgroundTask<?> task)
BackgroundTaskManager
.task
- task to be runpublic void schedule(com.google.common.collect.ImmutableList<? extends BackgroundTask<?>> taskList)
BackgroundTaskManager
.taskList
- list of tasks to be runpublic BackgroundTaskManager getManager()
public void close()
close
in interface Scope
close
in interface AutoCloseable