Re: [HACKERS] LISTEN/NOTIFY enhancement: Portable signal handling?

2005-10-24 Thread Zygo Blaxell
In case anyone's wondering why I'm replying to an article that's nearly a year old, it came up in a search while I was looking for the more recent LISTEN/NOTIFY thread... In article [EMAIL PROTECTED], Tom Lane [EMAIL PROTECTED] wrote: Sean Chittenden [EMAIL PROTECTED] writes: The async

[HACKERS] LISTEN/NOTIFY enhancement: Portable signal handling?

2004-12-27 Thread Sean Chittenden
Howdy. I'm starting some work on our favorite LISTEN/NOTIFY subsystem in the hopes of more advanced functionality. Right now I'm using a bastardized (RAISE NOTICE + tailing error logs) + NOTIFY to get what should just be built in to the LISTEN/NOTIFY interface. Here's the syntax for the

Re: [HACKERS] LISTEN/NOTIFY enhancement: Portable signal handling?

2004-12-27 Thread Magnus Hagander
Basically I want to introduce formal support for turning PostgreSQL into a message bus. To start with, it won't be a scalable message bus that can scale to thousands of concurrent connections (that's something I'd like to do long term(tm), but I digress). The problem is with the

Re: [HACKERS] LISTEN/NOTIFY enhancement: Portable signal handling?

2004-12-27 Thread Tom Lane
Sean Chittenden [EMAIL PROTECTED] writes: * Allow LISTEN to block until a value changes. LISTEN [BLOCK|WAIT] 'relname' * Allow LISTEN to have a timeout LISTEN name [BLOCK] [WITH] [TIMEOUT [=] ''::INTERVAL]; * Allow blocking LISTEN queries to update the status of the proc title

Re: [HACKERS] LISTEN/NOTIFY enhancement: Portable signal handling?

2004-12-27 Thread Tom Lane
Sean Chittenden [EMAIL PROTECTED] writes: The async interface is nice, but not really useful to me as it requires polling, instead of unblocking when an event comes through, which would create a vastly more real time interface that should be easier on the database. BTW, this is nonsense;

Re: [HACKERS] LISTEN/NOTIFY enhancement: Portable signal handling?

2004-12-27 Thread Merlin Moncure
Sean Chittenden wrote: Option 1) Use sleep(3) for the given timeout and wake up on some interruptible a signal (USR2?). This is the simplest solution, but likely the least portable to win32. Given the new world order of 8.0 and it's portability headaches, it's something I'm aware of.

Re: [HACKERS] LISTEN/NOTIFY enhancement: Portable signal handling?

2004-12-27 Thread Sean Chittenden
NOTIFY 'relname' a_expr; This would be great to have...at least I think this is what you are driving at: (adding a noiseword for readability) LISTEN system_messages; NOTIFY system_messages MESSAGE logoff; NOTIFY request_unlock MESSAGE 12345; -- for use with user locks! Hrm... the userlock module

Re: [HACKERS] LISTEN/NOTIFY enhancement: Portable signal handling?

2004-12-27 Thread Sean Chittenden
The async interface is nice, but not really useful to me as it requires polling, instead of unblocking when an event comes through, which would create a vastly more real time interface that should be easier on the database. BTW, this is nonsense; the backend sends a message exactly when the