MediaWiki REL1_39
EventRelayer.php
Go to the documentation of this file.
1<?php
20use Psr\Log\LoggerAwareInterface;
21use Psr\Log\LoggerInterface;
22use Psr\Log\NullLogger;
23
29abstract class EventRelayer implements LoggerAwareInterface {
31 protected $logger;
32
38 public function __construct( array $params ) {
39 $this->logger = new NullLogger();
40 }
41
47 final public function notify( $channel, $event ) {
48 return $this->doNotify( $channel, [ $event ] );
49 }
50
56 final public function notifyMulti( $channel, $events ) {
57 return $this->doNotify( $channel, $events );
58 }
59
60 public function setLogger( LoggerInterface $logger ) {
61 $this->logger = $logger;
62 }
63
69 abstract protected function doNotify( $channel, array $events );
70}
Base class for reliable event relays.
setLogger(LoggerInterface $logger)
LoggerInterface $logger
notify( $channel, $event)
notifyMulti( $channel, $events)
doNotify( $channel, array $events)
__construct(array $params)