add async feature #1

Merged
b4tman merged 62 commits from async into master 2023-08-18 06:29:46 +00:00
Showing only changes of commit 2c3950ccfc - Show all commits

View File

@ -170,8 +170,10 @@ async fn read_from_db(id: u32) -> Option<Question> {
}
async fn write_db() {
let (tx, rx) = mpsc::unbounded_channel::<Question>();
let (r, _) = tokio::join!(tokio::spawn(zip_reader_task(tx)), db_writer_task(rx),);
r.expect("tokio join");
tokio::try_join!(
tokio::spawn(zip_reader_task(tx)),
tokio::spawn(db_writer_task(rx))
).expect("tokio join");
println!("all done");
}
async fn db_writer_task(rx: UnboundedReceiver<Question>) {