MediaWiki master
EventRelayer.php
Go to the documentation of this file.
1<?php
22
23use Psr\Log\LoggerAwareInterface;
24use Psr\Log\LoggerInterface;
25use Psr\Log\NullLogger;
26
32abstract class EventRelayer implements LoggerAwareInterface {
34 protected $logger;
35
41 public function __construct( array $params ) {
42 $this->logger = new NullLogger();
43 }
44
50 final public function notify( $channel, $event ) {
51 return $this->doNotify( $channel, [ $event ] );
52 }
53
59 final public function notifyMulti( $channel, $events ) {
60 return $this->doNotify( $channel, $events );
61 }
62
63 public function setLogger( LoggerInterface $logger ) {
64 $this->logger = $logger;
65 }
66
72 abstract protected function doNotify( $channel, array $events );
73}
74
76class_alias( EventRelayer::class, 'EventRelayer' );
array $params
The job parameters.
Base class for reliable event relays.
doNotify( $channel, array $events)
setLogger(LoggerInterface $logger)