FutureRecordMetadata

class kafka.producer.future.FutureRecordMetadata(produce_future, batch_index, timestamp_ms, checksum, serialized_key_size, serialized_value_size, serialized_header_size)[source]

An asynchronous handle to the result of a single send().

send() returns one of these immediately, before the record has been transmitted to the broker. Call get() to block until the record is acknowledged and obtain its RecordMetadata, or register callbacks via add_callback() / add_errback() to be notified without blocking. The future resolves successfully once the containing batch is acknowledged according to the producer’s acks configuration, or fails with the relevant exception (for example KafkaTimeoutError).

get(timeout=None)[source]

Wait for up to timeout seconds for future to complete.