substrate
substrate copied to clipboard
Expose freezer sink max flush count and period
This gives the user more control on how often the sink will flush. Using ticker instead of timer makes the implementation simpler and makes sure messages gets flushed periodically.
This looks like it will:
- flush even if there is nothing to flush
- potentially flush after very few entries, just as an accident of where the ticker is and when the writes start compared to that.
Is this what we want?
Ah yeah, I will fix the first bit. The second one is more of a question about what behaviour we want. With the old implementation if we kept writing 2 messages per second then it might end up flushing only after 8.5 minutes, so it might take this long to get an acknowledgement back. With this implementation the longest time to get an acknowledgement is 1 second by default or whatever you specify.