@jyn oh I'm referring to futures vs tasks -- futures need to be driven externally while tasks are driven by the executor to completion
Top-level
11 comments
@predrag @jyn let's say you're traversing a Merkle linked list (in this case a chain of source control commits) to fold over them recursively -- if you just create a child future with the recursive call then await it, your task stack will grow in an unbounded fashion. If you spawn a new task for each node instead, this isn't an issue @predrag @jyn Good question! This is best modeled by a oneshot channel: https://docs.rs/tokio/latest/tokio/sync/oneshot/index.html |
@rain ahh got it
hmm i think i haven't heard that distinction using those words, i know rust has the first model and javascript has the latter but i've always considered "future" and "task" synonymous until now