setStatsCb

Description

public function setStatsCb(callable $callback): void {}

Set a statistics callback
The statistics callback is triggered every statistics.interval.ms (needs to be configured separately).

Example

$conf = new SimpleKafkaClient\Configuration();
$conf->setStatsCb(
    function (SimpleKafkaClient\Kafka $kafka, string $json, int $jsonLength) {
        //do something
    }
);