don't send empty batches
@@ -293,6 +293,7 @@ impl<T:Timestamp, D: Data> Handle<T, D> {
/// This method flushes single elements previously sent with `send`, to keep the insertion order.
pub fn send_batch(&mut self, buffer: &mut Vec<D>) {
+ if !buffer.is_empty() {
// flush buffered elements to ensure local fifo.
if !self.buffer1.is_empty() { self.flush(); }
@@ -310,6 +311,7 @@ impl<T:Timestamp, D: Data> Handle<T, D> {
}
buffer.clear();
}
+ }
/// Advances the current epoch to `next`.
///
