Package jetbrains.buildServer.serverSide
Interface MultiNodeTasks
-
- All Known Implementing Classes:
MultiNodeTasksDbImpl
public interface MultiNodeTasks
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
MultiNodeTasks.PerformingTask
static interface
MultiNodeTasks.PersistedTask
static interface
MultiNodeTasks.SubmittedTask
static interface
MultiNodeTasks.Task
static class
MultiNodeTasks.TaskConsumer
static class
MultiNodeTasks.TaskData
-
Method Summary
-
-
-
Method Detail
-
submit
@NotNull MultiNodeTasks.SubmittedTask submit(@NotNull MultiNodeTasks.Task taskData)
-
subscribe
void subscribe(@NotNull String taskType, @NotNull MultiNodeTasks.TaskConsumer consumer)
Subscribes a consumer for the task of the specified type. The task may not be accepted by the consumer, in this case it should throwCannotAcceptTaskException
.- Parameters:
taskType
-consumer
-
-
unsubscribe
void unsubscribe(@NotNull String taskType)
Unsubscribes a consumer for the task of the specified type.
-
subscribeOnSingletonTask
void subscribeOnSingletonTask(@NotNull String taskType, @NotNull MultiNodeTasks.TaskConsumer consumer)
Subscribe for a task that is guaranteed to be executed only once per identity: when the second task with the same identity is found it's marked as finished immediately, without calling subscribers.
-
findTasks
@NotNull List<MultiNodeTasks.SubmittedTask> findTasks(@NotNull Collection<String> taskTypes)
-
findTaskById
@Nullable MultiNodeTasks.SubmittedTask findTaskById(int id)
-
findInProgressTasks
@NotNull List<MultiNodeTasks.SubmittedTask> findInProgressTasks(@NotNull Collection<String> taskTypes)
-
findInProgressTasks
@NotNull List<MultiNodeTasks.SubmittedTask> findInProgressTasks()
- Returns:
- all currently in progress tasks
- Since:
- 2019.1
-
findPendingTasks
@NotNull List<MultiNodeTasks.SubmittedTask> findPendingTasks(@NotNull Collection<String> taskTypes)
-
findTask
@Nullable MultiNodeTasks.SubmittedTask findTask(@NotNull String taskType, @NotNull String taskIdentity)
-
getUnfinishedTasks
@NotNull List<MultiNodeTasks.SubmittedTask> getUnfinishedTasks()
Returns currently known pending and in-progress tasks.
The list includes tasks created by the current and by other nodes.
Note: contrary to various find* methods, this method does not fetch the data from the database, instead it returns the list which is updated periodically and may not contain the most up-to-date information.
The tasks are sorted by their creation time, the oldest comes first.
- Returns:
- the currently known list of pending and in progress tasks
- Since:
- 2022.10
-
findFinishedTasks
@NotNull List<MultiNodeTasks.SubmittedTask> findFinishedTasks(@NotNull Collection<String> taskTypes, long finishTimeThresholdMs)
-
addListener
void addListener(@NotNull MultiNodeTasksListener listener)
-
removeListener
void removeListener(@NotNull MultiNodeTasksListener listener)
-
getLastTaskId
long getLastTaskId()
- Returns:
- the id of the last created task
-
-