ResourceSubscriber class
Handles MCP resource subscribe / unsubscribe, initial read, and runtime binding registration (MOD-RUNTIME-004, FR-RES-001~004).
Tracks active subscriptions per ownerKey (typically a serverId) so the
orchestrator can unsubscribe all on close without the caller enumerating.
Constructors
- ResourceSubscriber({Logger? logger})
Properties
-
activeSubscriptions
→ Map<
String, Set< String> > -
Snapshot of active subscription URIs per ownerKey (test helper).
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
subscribe(
{required Client client, required MCPUIRuntime runtime, required String uri, String? binding, String? ownerKey}) → Future< void> - FR-RES-001~003
-
toString(
) → String -
A string representation of this object.
inherited
-
unsubscribe(
{required Client client, required MCPUIRuntime runtime, required String uri, String? ownerKey}) → Future< void> - FR-RES-004
-
unsubscribeAllFor(
{required Client client, required MCPUIRuntime runtime, required String ownerKey}) → Future< void> -
Unsubscribes every resource associated with
ownerKey. Used by the orchestrator'scloseApppath to prevent leaked subscriptions.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited