RegistryChangePublisher
FinalYes
Turns the registry's own change events into the notifications a `subscriptions/listen` stream carries.
The registry already announces every mutation to the PSR-14 dispatcher; this
is the adapter that puts them where a stream can read them, so a runtime
registerTool() reaches a listening client without the caller knowing a bus
exists.
There is no template-list notification in the protocol, so a changed resource-template list is announced as a changed resource list — which is what a client would refetch anyway.
Tags
Table of Contents
Properties
Methods
- __construct() : mixed
- listeners() : array<class-string, callable(object): void>
- Every event this publisher handles, keyed by event class.
- onPromptListChanged() : void
- onResourceListChanged() : void
- onResourceTemplateListChanged() : void
- onToolListChanged() : void
Properties
$bus read-only
private
NotificationBusInterface
$bus
Methods
__construct()
public
__construct(NotificationBusInterface $bus) : mixed
Parameters
- $bus : NotificationBusInterface
listeners()
Every event this publisher handles, keyed by event class.
public
listeners() : array<class-string, callable(object): void>
Shaped for a dispatcher that wants a map; a framework's own subscriber conventions can read it too rather than restating the list.
Return values
array<class-string, callable(object): void>onPromptListChanged()
public
onPromptListChanged(PromptListChangedEvent $event) : void
Parameters
- $event : PromptListChangedEvent
onResourceListChanged()
public
onResourceListChanged(ResourceListChangedEvent $event) : void
Parameters
- $event : ResourceListChangedEvent
onResourceTemplateListChanged()
public
onResourceTemplateListChanged(ResourceTemplateListChangedEvent $event) : void
Parameters
- $event : ResourceTemplateListChangedEvent
onToolListChanged()
public
onToolListChanged(ToolListChangedEvent $event) : void
Parameters
- $event : ToolListChangedEvent