Since: 1.3.0

interface CommandSubscriber implements Subscriber (View source)

Classes may implement this interface to register an event subscriber that is notified for each started, successful, and failed command event.

Methods

void
commandFailed(CommandFailedEvent $event)

Notification method for a failed command.

void
commandStarted(CommandStartedEvent $event)

Notification method for a started command.

void
commandSucceeded(CommandSucceededEvent $event)

Notification method for a successful command.

Details

void commandFailed(CommandFailedEvent $event)

Since: 1.3.0

Notification method for a failed command.

If the subscriber has been registered with MongoDB\Driver\Monitoring\addSubscriber(), the driver will call this method when a command has failed.

Parameters

CommandFailedEvent $event

An event object encapsulating information about the failed command.

Return Value

void

Exceptions

InvalidArgumentException

void commandStarted(CommandStartedEvent $event)

Since: 1.3.0

Notification method for a started command.

If the subscriber has been registered with MongoDB\Driver\Monitoring\addSubscriber(), the driver will call this method when a command has started.

Parameters

CommandStartedEvent $event

An event object encapsulating information about the started command.

Return Value

void

Exceptions

InvalidArgumentException

void commandSucceeded(CommandSucceededEvent $event)

Since: 1.3.0

Notification method for a successful command.

If the subscriber has been registered with MongoDB\Driver\Monitoring\addSubscriber(), the driver will call this method when a command has succeeded.

Parameters

CommandSucceededEvent $event

An event object encapsulating information about the successful command.

Return Value

void

Exceptions

InvalidArgumentException