poll

Description

public function poll(int $timeoutMs): int {}

Polls for events, provided callbacks will be called accordingly

Example

$conf = SimpleKafkaClient\Configuration();
$conf->set('metadata.broker.list', 'kafka:9092');
$producer = new SimpleKafkaClient\Producer($conf);
// produce some messsages
$producer->poll(0);
The producer needs to call poll at regular intervals to serve any queued callbacks
waiting to be called, otherwise the internal queue fill up and block the producer.