Class DefaultTaskRegistry
java.lang.Object
dev.tachyonmcp.core.server.features.AbstractRegistry<TaskDescriptor,TaskEntry>
dev.tachyonmcp.core.server.features.tasks.DefaultTaskRegistry
- All Implemented Interfaces:
Tasks,TaskRegistry
@InternalApi
public class DefaultTaskRegistry
extends AbstractRegistry<TaskDescriptor,TaskEntry>
implements TaskRegistry
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidbooleancancelTask(String taskId) booleancompleteTask(String taskId, @Nullable String resultJson) create()create(TaskOptions options) createSessionTask(@Nullable Duration ttl, @Nullable Map<String, Object> meta, @Nullable String sessionId, @Nullable ProgressToken progressToken) boolean@Nullable TaskEntrygetAndCancelTask(String taskId) @Nullable TaskEntryvoidregisterRunning(String taskId, Future<?> future) booleanRemoves a task from the registry, e.g. because it was removed on the caller's side.voidvoidvoidunregisterRunning(String taskId) booleanupdateStatus(String taskId, TaskState newStatus, @Nullable String statusMessage) Methods inherited from class dev.tachyonmcp.core.server.features.AbstractRegistry
addItem, addItemIfAbsent, defaultPageSize, fireOnChange, get, getAll, isEmpty, list, list, listItems, onChange, removeItem
-
Constructor Details
-
DefaultTaskRegistry
-
-
Method Details
-
getById
- Specified by:
getByIdin interfaceTaskRegistry
-
add
- Specified by:
addin interfaceTaskRegistry
-
remove
Description copied from interface:TasksRemoves a task from the registry, e.g. because it was removed on the caller's side. A non-terminal task is cancelled first (firing a final status notification) so itsTask.completion()doesn't hang forever. -
create
-
create
-
createSessionTask
public TaskEntry createSessionTask(@Nullable Duration ttl, @Nullable Map<String, Object> meta, @Nullable String sessionId, @Nullable ProgressToken progressToken) - Specified by:
createSessionTaskin interfaceTaskRegistry
-
registerRunning
- Specified by:
registerRunningin interfaceTaskRegistry
-
unregisterRunning
- Specified by:
unregisterRunningin interfaceTaskRegistry
-
completeTask
-
failTask
-
cancelTask
-
getAndCancelTask
-
updateStatus
- Specified by:
updateStatusin interfaceTaskRegistry
-
startTtlJanitor
public void startTtlJanitor() -
stopTtlJanitor
public void stopTtlJanitor()
-