Future
An object that stands for a result that is not ready yet, which you can wait on later to get the value or the error.
In more detail
Futures let a program start slow work, carry on, and collect the outcome when it needs it. Waiting on a future blocks until the result or an error is available.
Examples
kafka-python: producer.send returns a future; get(timeout=10) waits for the broker to acknowledge.meta = producer.send(topic, value=b"x").get(timeout=10)Related terms
- KafkaProducer — The kafka-python class that buffers records, batches them and sends them to Kafka in the background.
- RecordMetadata — The object a producer's future returns once the broker accepts a record, holding the topic, partition and offset it was written to.
- acks — The producer setting that decides how many brokers must confirm a record before the send counts as successful: 0, 1 or all.
Taught in
- Where A Record Lands — Confluent Apache Kafka Certifications (CCDAK and CCAAK) Exam Prep
- Green Tests, Red Production — Confluent Apache Kafka Certifications (CCDAK and CCAAK) Exam Prep
- A Producer In Python — Apache Kafka & Event Streaming
- Acknowledgements: What Acks Means For Durability — Apache Kafka & Event Streaming