forked from modelcontextprotocol/php-sdk
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathSubscriptionManagerInterface.php
More file actions
53 lines (46 loc) · 1.45 KB
/
SubscriptionManagerInterface.php
File metadata and controls
53 lines (46 loc) · 1.45 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
<?php
/*
* This file is part of the official PHP MCP SDK.
*
* A collaboration between Symfony and the PHP Foundation.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Mcp\Server\Resource;
use Mcp\Server\Protocol;
use Mcp\Server\Session\SessionInterface;
use Psr\SimpleCache\InvalidArgumentException;
/**
* Resource subscription interface.
*
* @author Larry Sule-balogun <suleabimbola@gmail.com>
*/
interface SubscriptionManagerInterface
{
/**
* Subscribes a session to a specific resource URI.
*
* @throws InvalidArgumentException
*/
public function subscribe(SessionInterface $session, string $uri): void;
/**
* Unsubscribes a session from a specific resource URI.
*
* @throws InvalidArgumentException
*/
public function unsubscribe(SessionInterface $session, string $uri): void;
/**
* Check if a session is subscribed to a resource URI.
*
* @throws InvalidArgumentException
*/
public function isSubscribed(SessionInterface $session, string $uri): bool;
/**
* Notifies all sessions subscribed to the given resource URI that the
* resource has changed. Sends a ResourceUpdatedNotification for each subscriber.
*
* @throws InvalidArgumentException
*/
public function notifyResourceChanged(Protocol $protocol, SessionInterface $session, string $uri): void;
}