I may be wrong, but I think the postgresql listen/notify will require polling, too. So that's not really an option for "instant push".
This gist of mine shows where you have to SELECT null in order to get the socket to send along any unprocessed notifications, at which point you can get all notifications available on the connection.
I may be wrong, but I think the postgresql listen/notify will require polling, too. So that's not really an option for "instant push".
This gist of mine shows where you have to SELECT null in order to get the socket to send along any unprocessed notifications, at which point you can get all notifications available on the connection.
https://gist.github.com/3915671#file-reel_ws_pg_example-rb-L21
Also, Tony Arcieri's reel is an excellent alternative in many respects to using live.