[−][src]Function dbcrossbarlib::tokio_glue::run_futures_with_runtime
pub fn run_futures_with_runtime(
cmd_future: BoxFuture<()>,
worker_future: BoxFuture<()>
) -> Result<()>
Create a new tokio
runtime and use it to run cmd_future
(which carries
out whatever task we want to perform), and worker_future
(which should
have been created by Context::create
or Context::create_for_test
).
Return when at least one future has failed, or both futures have completed successfully.
This can be safely used from within a test, but it may only be called from a synchronous context.
If this hangs, make sure all Context
values are getting dropped once the
work is done.