Subscription class final

One open subscription, opened by ServerConnection.listen.

On versions defining subscriptions/listen, the server stamps the id of that request on every message it sends on the stream. On legacy versions, this is a local view of the connection's list-changed and resource update notifications.

See https://modelcontextprotocol.io/specification/2026-07-28/basic/patterns/subscriptions.

Properties

acknowledged → Future<SubscriptionFilter>
The notification types the server agreed to send.
no setter
done → Future<void>
Completes when this subscription closes locally or remotely.
no setter
hashCode → int
The hash code for this object.
no setterinherited
id → RequestId?
The JSON-RPC ID of the subscriptions/listen request that opened this subscription.
final
notifications → Stream<SubscriptionNotification>
The notifications the server sent on this subscription.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

close() → Future<void>
Stops this subscription without closing its connection.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited