-
-
Notifications
You must be signed in to change notification settings - Fork 505
Closed
Description
I have this simple test program:
let conn = Connection::connect("postgres://test:test@localhost", &SslMode::None).unwrap();
conn.execute("LISTEN chan", &[]);
let notifications = conn.notifications();
conn.execute("NOTIFY chan, 'rust'", &[]);
let mut it = notifications.iter();
for i in 0..99999999 {
let a = it.next();
match a {
Some(b) => {
println!("{:?}", b);
}
_ => {}
}
}
The notification that I send with 'rust' as payload gets printed, and everything looks fine. However, if I then go into psql, and send NOTIFY chan, 'psql';
while the loop is running, that notification never seems to show up.
I also did a long sleep while I sent notifications from psql, instead of long loop, but that didn't have any other effect. (Not that I really know why it would)
The other way works fine however. If I LISTEN chan;
from psql, then I receive the 'rust' payload.
I'm probably doing something wrong that has an easy fix, but I can't work out what it is, any help would be appreciated. :)
$ rustc --version
rustc 1.5.0-beta.2 (b0f440163 2015-10-28)
$ psql --version
psql (PostgreSQL) 9.4.5
Metadata
Metadata
Assignees
Labels
No labels