Show HN: Rust macro utility for batching expensive async operations
1–10 of 11 posts
Re: Show HN: Rust macro utility for batching expensive async operations
#2Re: Show HN: Rust macro utility for batching expensive async operations
#3Why 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.
Re: Show HN: Rust macro utility for batching expensive async operations
#4Re: Show HN: Rust macro utility for batching expensive async operations
#5Like a sempahore?
Re: Show HN: Rust macro utility for batching expensive async operations
#6Re: Show HN: Rust macro utility for batching expensive async operations
#7Are window sizes dynamic, or do they need to be specified at build time?
Re: Show HN: Rust macro utility for batching expensive async operations
#8The 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?
Re: Show HN: Rust macro utility for batching expensive async operations
#9Need 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…
Re: Show HN: Rust macro utility for batching expensive async operations
#10Are window sizes dynamic, or do they need to be specified at build time?
Need to be specified at build time, but you can set a dynamic window length based on the current buffer length. https://github.com/hackermondev/batched?tab=readme-ov-file#b...