kafka-go
kafka-go copied to clipboard
Add flush method to writer
Add Flush method to writer.
The Flush method immediately writes the current batch to each partition no matter the batch size or timeout. This is useful to manage the Writer batching yourself. For instance, one might want to write 10 messages in series, and then force a flush, even if by default, the batch size would wait for 100 messages.
Flush holds the internal w.mutex when called.
This is part of the API suggested in https://github.com/segmentio/kafka-go/issues/852, but only a piece of it.