nlopes / libhoney-rust

Rust library for sending data to Honeycomb
MIT License
23 stars 16 forks source link

Queued events are ignored when flushing client #65

Open ramosbugs opened 3 years ago

ramosbugs commented 3 years ago

The client flush method is implemented in terms of stopping and restarting the Transmission: https://github.com/nlopes/libhoney-rust/blob/2f7cdc8b9035e2c1c9605c3476640e7f70400471/src/client.rs#L122-L133

Unfortunately, the stop event causes a break that breaks out of the loop and doesn't send any of the queued events: https://github.com/nlopes/libhoney-rust/blob/62d6da9f6ba49cded6770ea127cd3cf803b653e2/src/transmission.rs#L212-L215

I think the code should probably jump to this line instead of breaking out of the loop: https://github.com/nlopes/libhoney-rust/blob/62d6da9f6ba49cded6770ea127cd3cf803b653e2/src/transmission.rs#L238