wbarnha / kafka-python-ng

Fork for Python client for Apache Kafka
https://wbarnha.github.io/kafka-python-ng/
Apache License 2.0
67 stars 8 forks source link

Flush before close #149

Open wbarnha opened 6 months ago

wbarnha commented 6 months ago

If there are any messages pending, flush them before doing anything else. This makes it more likely that callbacks have a chance to run before the producer is closed, which can help in corner cases (like when callbacks want to send another message)


This change is Reviewable

antonagestam commented 6 months ago

Is it possible to add a regression test for this?

wbarnha commented 6 months ago

regression tes

My thoughts as well, I'm wondering if the default behavior of not flushing was retained for a particular reason.