Completes the plugin connection lifecycle. v0.3.0 shipped onSubscribe but no onUnsubscribe, and PluginContext::connectionsOn() (read) with no write-side counterpart. A plugin could see a connection join a channel but not leave one short of a full disconnect, and could not evict a connection from a single channel without terminating the whole socket. Both gaps are now closed.
Added
ConnectionLifecycle::onUnsubscribe(Connection, Channel)- fires when a connection leaves a channel via the explicitpusher:unsubscribeevent.PluginManager::notifyUnsubscribe()- exception-isolated fan-out for the new hook.PluginContext::unsubscribe(Connection, string $channel)- removes a connection from one channel, leaving the socket and its other subscriptions intact. A direct action; it does not itself emitonUnsubscribe.
Changed
ConnectionLifecyclegains a fourth method,onUnsubscribe. Breaking for existing implementers of the interface; the plugin system is one release old, so the contract is completed before it settles.EventHandler::unsubscribe()fires theonUnsubscribelifecycle hook after removing the connection from the channel. A closing connection is still reported once throughonClose, not as one unsubscribe per channel.
Suite grows to 317 tests.