ServerPushChannel.addListener

Register a connected GET listener and return its id. Each listener gets a distinct stream ordinal so its event ids stay globally unique within the mount/session. When subscriptionId is non-empty (a subscriptions/listen stream), every notification delivered to this listener is stamped with it in params._meta["io.modelcontextprotocol/subscriptionId"].

resumeFrom carries the client's Last-Event-ID (basic/transports §Resumability and Redelivery). When it parses to <ordinal>-<seq> for a stream ordinal this channel still has buffered history for, the listener resumes *that* stream rather than allocating a fresh ordinal: the events with a higher sequence are replayed onto the new writer in order, and subsequent events continue the same ordinal from where it left off. This is the server-side half of resumability — the "server MAY use this header to replay messages that would have been sent after the last event ID, on the stream that was disconnected". An empty or unrecognized resumeFrom falls back to a fresh ordinal, so a normal GET opens a brand-new stream. The MUST NOT — "replay messages that would have been delivered on a different stream" — is honoured because replay is keyed strictly on the id's ordinal.

class ServerPushChannel
@safe
long
addListener
(
void delegate
(
string frame
)
@safe
write
,
string subscriptionId = ""
,,
string resumeFrom = ""
,
bool delegate
(
string method
,
string uri
)
@safe
plainEligible = null
,
string ownerToken = ""
)