MediaWiki master
EventRelayer.php
Go to the documentation of this file.
1<?php
8
9use Psr\Log\LoggerAwareInterface;
10use Psr\Log\LoggerInterface;
11use Psr\Log\NullLogger;
12
18abstract class EventRelayer implements LoggerAwareInterface {
20 protected $logger;
21
27 public function __construct( array $params ) {
28 $this->logger = new NullLogger();
29 }
30
36 final public function notify( $channel, $event ) {
37 return $this->doNotify( $channel, [ $event ] );
38 }
39
45 final public function notifyMulti( $channel, $events ) {
46 return $this->doNotify( $channel, $events );
47 }
48
49 public function setLogger( LoggerInterface $logger ): void {
50 $this->logger = $logger;
51 }
52
58 abstract protected function doNotify( $channel, array $events );
59}
60
62class_alias( EventRelayer::class, 'EventRelayer' );
Base class for reliable event relays.
doNotify( $channel, array $events)
setLogger(LoggerInterface $logger)