MCP PHP SDK

PublishingEventDispatcher implements EventDispatcherInterface

FinalYes

Publishes registry change events onto a notification bus, then passes them on.

PSR-14 splits dispatching from listener registration, and the SDK is only handed the dispatcher half — so it cannot register a listener on an application's own dispatcher. This decorator is the way round that: configure a bus and the SDK wraps whatever dispatcher it was given (or stands in for one), so a runtime registerTool() reaches a listening client without the caller wiring anything.

An application with its own listener provider can skip this and register RegistryChangePublisher::listeners() itself.

Tags
author

Christopher Hertel mail@christopher-hertel.de

Table of Contents

Interfaces

EventDispatcherInterface

Properties

$inner  : EventDispatcherInterface|null
$listeners  : array<class-string, callable(object): void>

Methods

__construct()  : mixed
dispatch()  : object

Properties

Methods

On this page

Search results