sapling/futures-ext
Simon Farnsworth 0ad8dcc0da Split asynchronize into useful components
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
2018-09-05 12:23:49 -07:00
..
src Split asynchronize into useful components 2018-09-05 12:23:49 -07:00
Cargo.toml Add Cargo.toml files to crates. (#7) 2018-07-09 19:52:27 -07:00