Skip to main content

Module tasks

Module tasks 

Source
Expand description

Task capability implementation.

Tasks let a server run a long-running operation while the caller polls for status (tasks/get) and, once terminal, the payload (tasks/result).

The store itself (TaskManager, TaskHandle, route_task_store) is shared with the client side and lives in mcpkit_core::tasks; this module re-exports it and adds the server-only TaskService.

Structs§

TaskEvent
A task status transition observed by the store.
TaskHandle
Handle for driving a tracked task to a terminal state.
TaskManager
Manager coordinating the lifecycle of tracked tasks.
TaskService
Task service implementing the TaskHandler trait over a TaskManager.
TaskState
Internal state for a tracked task.
TaskStatusNotifier
Publishes notifications/tasks/status when a task changes status.

Enums§

TaskPayload
The terminal outcome of the request a task wraps.
TaskRoute
What a task store decided about a request.

Constants§

DEFAULT_TASK_TTL_MS
Default retention for a terminal task whose request omitted a ttl (one hour, in milliseconds). Override via TaskManager::with_default_ttl.
RELATED_TASK_META_KEY
The _meta key associating a message with a task (io.modelcontextprotocol/related-task).

Traits§

NotificationSink
Where an ambient notification goes on a given transport.
TaskObserver
Observer notified of every task status transition in a TaskManager.

Functions§

route_task_store
Serve task queries from a TaskManager store.
session_task_store
Build a per-session task store that publishes notifications/tasks/status onto the session’s SSE stream registry.