let notifications = rx
.filter_map(|m| match m {
AsyncMessage::Notification(n) => {
println!("Notification {:?}", n);
// insert_stuff(connection_parameters, n.payload()) <-- insert new data into db, but here asking for add await
future::ready(Some(n))
},
_ => future::ready(None),
})
.collect::<Vec<_>>()
.await;
Hello, I'm trying to process the collected payload from a notification. When I receive notification from PostgreSQL database, I would like to insert new data into the db. I took the code from example https://github.com/sfackler/rust-postgres/blob/98f5a11bc0a8e451552d8941ffa078c7eb6cd60c/tokio-postgres/tests/test/main.rs#L736-L769 something like this:
Note: newbie in rust