vertx / io.vertx.kotlin.kafka.client.consumer / io.vertx.kafka.client.consumer.KafkaConsumer / pollAwait

# pollAwait

`suspend fun <K, V> KafkaConsumer<K, V>.pollAwait(timeout: Long): KafkaConsumerRecords<K, V>`

Executes a poll for getting messages from Kafka

### Parameters

`timeout` - The time, in milliseconds, spent waiting in poll if data is not available in the buffer. If 0, returns immediately with any records that are available currently in the native Kafka consumer's buffer, else returns empty. Must not be negative.

`handler` - handler called after the poll with batch of records (can be empty).