Y
Hacker News
new
|
ask
|
show
|
jobs
by
luckystarr
298 days ago
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?
1 comments
hackermondev
296 days 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.
link