Currently the support for Notify messages is pretty well undocumented. It looks like payload support is coming in 8.5, so it will be important for this to be more visible.
There are a few parts to implementing an appropriate set of listening interfaces:
- Subscribe/Unsubscribe interface (basically, emit N-LISTEN $id statements)?
- Notification hook management (punting here; single attribute, let user decide the implementation)
- wait() method for simple event loops
The simple wait()[db.listen()?] method will perform pg_sleep() function calls in order to keep an active protocol transaction. This would allow for interrupts to take place, tho, not reliably(small windows between sleep() calls)..
Currently the support for Notify messages is pretty well undocumented. It looks like payload support is coming in 8.5, so it will be important for this to be more visible.
There are a few parts to implementing an appropriate set of listening interfaces:
The simple wait()[db.listen()?] method will perform pg_sleep() function calls in order to keep an active protocol transaction. This would allow for interrupts to take place, tho, not reliably(small windows between sleep() calls)..