add async feature #1
@ -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");
|
||||||
|
Loading…
Reference in New Issue
Block a user