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 0adc11cabf - Show all commits

View File

@ -181,8 +181,8 @@ async fn db_writer_task(rx: UnboundedReceiver<Question>) {
.unwrap_or_else(|e| panic!("db writer load, {e:#?}")); .unwrap_or_else(|e| panic!("db writer load, {e:#?}"));
let stream: UnboundedReceiverStream<_> = rx.into(); let stream: UnboundedReceiverStream<_> = rx.into();
let stream = stream.map(Ok); let stream = stream;
stream.forward(writer.sink()).await.expect("forward"); writer.load(stream).await.expect("load");
writer.finish().await.expect("db writer finish"); writer.finish().await.expect("db writer finish");
println!("write done"); println!("write done");