Skip to content

Commit

Permalink
no tokio-unstable
Browse files Browse the repository at this point in the history
  • Loading branch information
hatoo committed Jan 4, 2025
1 parent 35727ec commit eb082f7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
2 changes: 0 additions & 2 deletions .cargo/config.toml

This file was deleted.

7 changes: 5 additions & 2 deletions src/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1123,14 +1123,17 @@ pub async fn work2(
let counter = counter.clone();
let client = client.clone();
std::thread::spawn(move || {
let rt = tokio::runtime::LocalRuntime::new().unwrap();
let rt = tokio::runtime::Builder::new_current_thread()
.enable_all()
.build()
.unwrap();

let futures = (0..num_connection)
.map(|_| {
let report_tx = report_tx.clone();
let counter = counter.clone();
let client = client.clone();
rt.spawn_local(async move {
rt.spawn(async move {
let mut client_state = ClientStateHttp1::default();
while counter.fetch_add(1, Ordering::Relaxed) < n_tasks {
let res = client.work_http1(&mut client_state).await;
Expand Down

0 comments on commit eb082f7

Please sign in to comment.