The MongoDB\Driver\Monitoring\SDAMSubscriber interface

Introduction

Classes may implement this interface to register an event subscriber that is notified for various SDAM events. See the » Server Discovery and Monitoring and » SDAM Monitoring specifications for additional information.

Interface synopsis

MongoDB\Driver\Monitoring\SDAMSubscriber
class MongoDB\Driver\Monitoring\SDAMSubscriber implements MongoDB\Driver\Monitoring\Subscriber {
/* Methods */
abstract public void serverChanged(MongoDB\Driver\Monitoring\ServerChangedEvent $event)
abstract public void serverClosed(MongoDB\Driver\Monitoring\ServerClosedEvent $event)
abstract public void serverHeartbeatFailed(MongoDB\Driver\Monitoring\ServerHeartbeatFailedEvent $event)
abstract public void serverHeartbeatStarted(MongoDB\Driver\Monitoring\ServerHeartbeatStartedEvent $event)
abstract public void serverHeartbeatSucceeded(MongoDB\Driver\Monitoring\ServerHeartbeatSucceededEvent $event)
abstract public void serverOpening(MongoDB\Driver\Monitoring\ServerOpeningEvent $event)
abstract public void topologyChanged(MongoDB\Driver\Monitoring\TopologyChangedEvent $event)
abstract public void topologyClosed(MongoDB\Driver\Monitoring\TopologyClosedEvent $event)
abstract public void topologyOpening(MongoDB\Driver\Monitoring\TopologyOpeningEvent $event)
}

Changelog

Version Description
PECL mongodb 1.15.0 Return types for methods are declared as tentative on PHP 8.0 and newer, triggering deprecation notices in code that implements this interface without declaring the appropriate return types. The #[ReturnTypeWillChange] attribute can be added to silence the deprecation notice.

Table of Contents