MCP PHP SDK

SessionSubscriptionManager implements SubscriptionManagerInterface

FinalYes

The default Subscription manager implementation manages subscriptions per session only.

It is in-memory and does not support cross-session or cross-client subscriptions.

The SDK allows injecting alternative SubscriptionManagerInterface implementations via Builder::setResourceSubscriptionManager().

Tags
author

Larry Sule-balogun suleabimbola@gmail.com

Table of Contents

Interfaces

SubscriptionManagerInterface
Resource subscription interface.

Properties

$logger  : LoggerInterface

Methods

__construct()  : mixed
isSubscribed()  : bool
Check if a session is subscribed to a resource URI.
notifyResourceChanged()  : void
Notifies all sessions subscribed to the given resource URI that the resource has changed. Sends a ResourceUpdatedNotification for each subscriber.
subscribe()  : void
Subscribes a session to a specific resource URI.
unsubscribe()  : void
Unsubscribes a session from a specific resource URI.

Properties

Methods

__construct()

public __construct([LoggerInterface $logger = new NullLogger() ]) : mixed
Parameters
$logger : LoggerInterface = new NullLogger()

notifyResourceChanged()

Notifies all sessions subscribed to the given resource URI that the resource has changed. Sends a ResourceUpdatedNotification for each subscriber.

public notifyResourceChanged(Protocol $protocol, SessionInterface $session, string $uri) : void
Parameters
$protocol : Protocol
$session : SessionInterface
$uri : string
Tags
throws
InvalidArgumentException

        
On this page

Search results