MediaWiki  1.33.0
EventRelayerKafka Class Reference

Event relayer for Apache Kafka. More...

Inheritance diagram for EventRelayerKafka:
Collaboration diagram for EventRelayerKafka:

Public Member Functions

 __construct (array $params)
 Create Kafka producer. More...
 
- Public Member Functions inherited from EventRelayer
 notify ( $channel, $event)
 
 notifyMulti ( $channel, $events)
 
 setLogger (LoggerInterface $logger)
 

Protected Member Functions

 doNotify ( $channel, array $events)
 
 getKafkaProducer ()
 Get the producer object from kafka-php. More...
 

Protected Attributes

Config $config
 Configuration. More...
 
Produce $producer
 Kafka producer. More...
 
- Protected Attributes inherited from EventRelayer
LoggerInterface $logger
 

Detailed Description

Event relayer for Apache Kafka.

Configuring for WANCache: 'relayerConfig' => [ 'class' => 'EventRelayerKafka', 'KafkaEventHost' => 'localhost:9092' ],

Definition at line 9 of file EventRelayerKafka.php.

Constructor & Destructor Documentation

◆ __construct()

EventRelayerKafka::__construct ( array  $params)

Create Kafka producer.

Parameters
array$params

Reimplemented from EventRelayer.

Definition at line 29 of file EventRelayerKafka.php.

References $params.

Member Function Documentation

◆ doNotify()

EventRelayerKafka::doNotify (   $channel,
array  $events 
)
protected
Parameters
string$channel
array$eventsList of event data maps
Returns
bool Success

Reimplemented from EventRelayer.

Definition at line 50 of file EventRelayerKafka.php.

References $e, $producer, and getKafkaProducer().

◆ getKafkaProducer()

EventRelayerKafka::getKafkaProducer ( )
protected

Get the producer object from kafka-php.

Returns
Produce

Definition at line 42 of file EventRelayerKafka.php.

References $producer.

Referenced by doNotify().

Member Data Documentation

◆ $config

Config EventRelayerKafka::$config
protected

Configuration.

Definition at line 15 of file EventRelayerKafka.php.

◆ $producer

Produce EventRelayerKafka::$producer
protected

Kafka producer.

Definition at line 22 of file EventRelayerKafka.php.

Referenced by doNotify(), and getKafkaProducer().


The documentation for this class was generated from the following file: