1: <?php
2:
3: declare(strict_types=1);
4:
5: /**
6: * This file is part of the Nexus MCP SDK package.
7: *
8: * (c) 2026 John Paul E. Balandan, CPA <paulbalandan@gmail.com>
9: *
10: * For the full copyright and license information, please view
11: * the LICENSE file that was distributed with this source code.
12: */
13:
14: namespace Nexus\Mcp\Server\Subscription;
15:
16: use Amp\DeferredFuture;
17: use Nexus\Mcp\Core\Handler\SenderInterface;
18: use Nexus\Mcp\Core\Schema\RequestId;
19: use Nexus\Mcp\Core\Schema\SubscriptionFilter;
20:
21: /**
22: * One open `subscriptions/listen` stream: the id every message on it carries, the notification types the
23: * server agreed to honour, and the pump that reaches the client.
24: */
25: final readonly class SubscriptionEntry
26: {
27: /**
28: * @param DeferredFuture<null> $closed Completed when the stream is torn down, releasing the held-open handler
29: */
30: public function __construct(
31: public RequestId $subscriptionId,
32: public SubscriptionFilter $honoured,
33: public SenderInterface $sender,
34: public DeferredFuture $closed,
35: ) {
36: }
37: }
38: