sentinel_driver/connection/
notify_impl.rs1use super::{notify, Connection, Notification, Result};
2
3impl Connection {
4 pub async fn listen(&mut self, channel: &str) -> Result<()> {
6 notify::listen(&mut self.conn, channel).await
7 }
8
9 pub async fn unlisten(&mut self, channel: &str) -> Result<()> {
11 notify::unlisten(&mut self.conn, channel).await
12 }
13
14 pub async fn unlisten_all(&mut self) -> Result<()> {
16 notify::unlisten_all(&mut self.conn).await
17 }
18
19 pub async fn notify(&mut self, channel: &str, payload: &str) -> Result<()> {
21 notify::notify(&mut self.conn, channel, payload).await
22 }
23
24 pub async fn wait_for_notification(&mut self) -> Result<Notification> {
28 notify::wait_for_notification(&mut self.conn).await
29 }
30}