Settings

Theme

Show HN: Rust macro utility for batching expensive async operations

github.com

28 points by hackermondev 5 months ago · 10 comments

Reader

bombela 4 months ago

Need to explain in the readme what it does, and what for.

Why would I need such an abstraction? What is the cost?

Why is that any better than calling the function with a single argument in the first place?

I assume here it is maintaining a vector of futures and and a sibling vector of input values. And when this vector reaches the window size or something like that, it calls the original function with must returns a vector of results, which are then used to resolve the futures.

luckystarr 4 months 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?

catlifeonmars 4 months ago

Are window sizes dynamic, or do they need to be specified at build time?

44za12 4 months ago

Like a sempahore?

  • 0x457 4 months ago

    Semaphore limits concurrency, this one automatically groups (batches) input.

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection