(PECL rdkafka >= 4.0.0, librdkafka >= 0.11.0)
RdKafka::flush — Wait until all outstanding produce requests, et.al, are completed.
$timeout_ms
) : integerWait until all outstanding produce requests, et.al, are completed. This should typically be done prior to destroying a producer instance to make sure all queued and in-flight produce requests are completed before terminating. This function will call poll() and thus trigger callbacks.
timeout_ms
(integer)Specifies the maximum amount of time (in milliseconds) that the call will block. To wait indefinitely provide -1.
In case of success returns RD_KAFKA_RESP_ERR_NO_ERROR
, in case of timeout RD_KAFKA_RESP_ERR__TIMED_OUT
and if not called on a producer instance RD_KAFKA_RESP_ERR__NOT_IMPLEMENTED
.