MediaWiki master
|
Implementation of DomainEventDispatcher and DomainEventSource based on HookContainer and DeferredUpdates. More...
Inherits MediaWiki\DomainEvent\DomainEventDispatcher, and MediaWiki\DomainEvent\DomainEventSource.
Public Member Functions | |
__construct (ObjectFactory $objectFactory) | |
dispatch (DomainEvent $event, IConnectionProvider $dbProvider) | |
Emit the given event to any listeners that have been registered for the respective event type. | |
registerListener (string $eventType, $listener, array $options=self::DEFAULT_LISTENER_OPTIONS) | |
Add a listener that will be notified on events of the given type. | |
registerSubscriber ( $subscriber) | |
Additional Inherited Members | |
![]() | |
const | DEFAULT_LISTENER_OPTIONS = [] |
Default options to apply when registering listeners. | |
Implementation of DomainEventDispatcher and DomainEventSource based on HookContainer and DeferredUpdates.
Since this implementation of DomainEventDispatcher is based on HookContainer, each event type also function as a hook name. This effectively means that there are two ways to get informed about an event: asynchronously, using a listener registered with an DomainEventSource; or synchronously, using a hook handler registered with the HookContainer.
Definition at line 22 of file EventDispatchEngine.php.
MediaWiki\DomainEvent\EventDispatchEngine::__construct | ( | ObjectFactory | $objectFactory | ) |
Definition at line 39 of file EventDispatchEngine.php.
MediaWiki\DomainEvent\EventDispatchEngine::dispatch | ( | DomainEvent | $event, |
IConnectionProvider | $dbProvider ) |
Emit the given event to any listeners that have been registered for the respective event type.
Listeners are invoked through DeferredUpdates.
Implements MediaWiki\DomainEvent\DomainEventDispatcher.
Definition at line 49 of file EventDispatchEngine.php.
MediaWiki\DomainEvent\EventDispatchEngine::registerListener | ( | string | $eventType, |
$listener, | |||
array | $options = self::DEFAULT_LISTENER_OPTIONS ) |
Add a listener that will be notified on events of the given type.
string | $eventType | |
callable | $listener | |
array | $options | Currently unused. In the future, $options may convey things like the listener priority or error handling. |
Implements MediaWiki\DomainEvent\DomainEventSource.
Definition at line 78 of file EventDispatchEngine.php.
MediaWiki\DomainEvent\EventDispatchEngine::registerSubscriber | ( | $subscriber | ) |
DomainEventSubscriber | array | $subscriber |
Implements MediaWiki\DomainEvent\DomainEventSource.
Definition at line 93 of file EventDispatchEngine.php.