mirror of
https://github.com/facebook/sapling.git
synced 2024-10-12 09:48:05 +03:00
0ad8dcc0da
Summary: `asynchronize` does two conceptually separate things: 1. Given a closure that can do blocking I/O or is CPU heavy, create a future that runs that closure inside a Tokio task. 2. Given a future, run it on a new Tokio task and shuffle the result back to the caller via a channel. Split these two things out into their own functions - one to make the future, one to spawn it and recover the result. For now, this is no net change - but `spawn_future` is likely to come in useful once we need more parallelism than we get from I/O alone, and `closure_to_blocking_future` at least signals intent when we allow a long-running function to take over a Tokio task. Reviewed By: jsgf Differential Revision: D9635812 fbshipit-source-id: e15aeeb305c8499219b89a542962cb7c4b740354 |
||
---|---|---|
.. | ||
src | ||
Cargo.toml |