Use multithreaded runtime in blocking client.

The runtime uses a single worker thread. Using a multithreaded runtime
allows futures that require a multithreaded runtime to run.
This commit is contained in:
Sergio Benitez 2021-04-07 19:35:47 -07:00
parent 6ad14dc3f6
commit 8a2592c257

View File

@ -33,7 +33,9 @@ pub struct Client {
impl Client {
fn _new(rocket: Rocket, tracked: bool) -> Result<Client, Error> {
let runtime = tokio::runtime::Builder::new_current_thread()
let runtime = tokio::runtime::Builder::new_multi_thread()
.thread_name("rocket-local-client-worker-thread")
.worker_threads(1)
.enable_all()
.build()
.expect("create tokio runtime");