Files
kiri-core/Kafka/Struct.php
T

35 lines
504 B
PHP
Raw Normal View History

2020-10-09 18:43:35 +08:00
<?php
2020-10-29 18:17:25 +08:00
declare(strict_types=1);
2020-10-09 18:43:35 +08:00
namespace Kafka;
2020-10-26 17:23:22 +08:00
use RdKafka\Message;
2020-10-09 18:43:35 +08:00
class Struct
{
2020-10-26 17:23:22 +08:00
public int $offset;
2020-10-09 18:43:35 +08:00
2020-10-26 17:23:22 +08:00
public Message $message;
public string $topic;
2020-10-09 18:43:35 +08:00
2020-10-30 01:34:24 +08:00
public ?string $value;
2020-10-29 18:17:25 +08:00
public int $part;
2020-10-09 18:43:35 +08:00
/**
* Struct constructor.
* @param $topic
* @param $message
*/
2020-10-26 17:25:24 +08:00
public function __construct($topic, Message $message)
2020-10-09 18:43:35 +08:00
{
$this->topic = $topic;
2020-10-26 17:23:22 +08:00
$this->offset = $message->offset;
$this->part = $message->partition;
$this->message = $message;
$this->value = $message->payload;
2020-10-09 18:43:35 +08:00
}
}