|
|
|
|
|
by laurencerowe
972 days ago
|
|
I'm not an expert, but my understanding is that Rust makes a distinction between Futures and Tasks, the top level Futures that are run by the executor. In JavaScript terms Futures are more like sugar around callbacks, they don't do anything until you call/poll them. Tasks are independent entities like Promises which are being run by the executor, though they may currently be blocked on other tasks. > the model I often want is I want to start some work, and then join at some later point - or even chain directly into the next task. Rust wants you to do this the other way around. First chain together your futures so that when you start the top level one as a task there is a single state machine for it to run. |
|