You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Use time.NewTimer(...) instead of time.NewTicker(...)
Reset this timer every time you receive a message (to extend the flush deadline).
If the timer expires (i.e., case <-flushTimer.C:), flush whatever messages have accumulated.
That way, for “hot” topics (lots of messages in short intervals), the timer keeps resetting and you primarily flush on message-count/byte-size constraints. For slower topics, you’ll flush after no new messages arrive within messageGroupDuration.
The text was updated successfully, but these errors were encountered:
Rolling Timer
time.NewTimer(...)
instead oftime.NewTicker(...)
That way, for “hot” topics (lots of messages in short intervals), the timer keeps resetting and you primarily flush on message-count/byte-size constraints. For slower topics, you’ll flush after no new messages arrive within messageGroupDuration.
The text was updated successfully, but these errors were encountered: