Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
luckystarr
· 1y ago · 0 comments
The API is great. Will definitely try it out. I have a use case already. How difficult would it be to extend this to support timed flushes? Like, every 200ms or so, regardless the fill of the buffer?
Comments
[–]
hackermondev
1y ago
That's what the `window` option does (
https://github.com/hackermondev/batched?tab=readme-ov-file#b...
). After the first item is added to the buffer, it waits for the maximum window time, then calls the inner function with the buffer fill.