Skip to content

Commit

Permalink
throw error
Browse files Browse the repository at this point in the history
  • Loading branch information
stneng committed Oct 11, 2022
1 parent cd82b1a commit bc6f0c0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/protocol.rs
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ pub fn _protocol_start(
let cl = cl.clone();
if protocol_and_role.ends_with(":@init") {
let protocol_name = protocol_and_role[..protocol_and_role.len() - 6].to_string();
let _ = tokio::runtime::Builder::new_multi_thread()
tokio::runtime::Builder::new_multi_thread()
.enable_all()
.build()
.unwrap()
Expand All @@ -188,14 +188,14 @@ pub fn _protocol_start(
}
cl.unlock(lock).await?;
Ok::<(), Box<dyn std::error::Error + Send + Sync + 'static>>(())
});
})?;
} else {
protocols.push(protocol_and_role[..protocol_and_role.rfind(':').unwrap()].to_string());
operator_funcs.insert(protocol_and_role, user_func);
}
}
let cl_clone = cl.clone();
let _ = tokio::runtime::Builder::new_multi_thread()
tokio::runtime::Builder::new_multi_thread()
.enable_all()
.build()
.unwrap()
Expand All @@ -206,7 +206,7 @@ pub fn _protocol_start(
cl_clone.update_entry(&is_initialized_key, &[1]).await?;
}
Ok::<(), Box<dyn std::error::Error + Send + Sync + 'static>>(())
});
})?;
for (protocol_and_role, user_func) in operator_funcs {
let cl = cl.clone();
thread::spawn(|| {
Expand Down

0 comments on commit bc6f0c0

Please sign in to comment.