Hacker News new | past | comments | ask | show | jobs | submit login

Is the idea that you might be fanning out and want to delay starting the event loop? Fanning out in JS looks like:

  const fn = async (arg) => { ... };  // calls some RPC
  const results = await Promise.all(args.map(fn))
which might technically be starting the first func before the second is in the event loop, but I don't see why that matters for what I'm doing.



In Rust (which is the async/await system mentioned in the article), futures don't start until they're polled, so doing the pattern you describe wouldn't even have the ordering part you mention (unless you wanted it to, in which case you could use something like Tokio's `spawn`).


It does matter for what I'm doing.


You said most use cases, so I was thinking of a typical backend that's handling requests, calling RPCs, doing DB queries, etc.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: