mirror of
https://github.com/rwf2/Rocket.git
synced 2025-01-31 13:52:08 +00:00
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:
parent
6ad14dc3f6
commit
8a2592c257
@ -33,7 +33,9 @@ pub struct Client {
|
|||||||
|
|
||||||
impl Client {
|
impl Client {
|
||||||
fn _new(rocket: Rocket, tracked: bool) -> Result<Client, Error> {
|
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()
|
.enable_all()
|
||||||
.build()
|
.build()
|
||||||
.expect("create tokio runtime");
|
.expect("create tokio runtime");
|
||||||
|
Loading…
Reference in New Issue
Block a user