Search Postgresql Archives

Re: How to get a signal from the database when a INSERT INTO is done?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Feb 28, 2012 at 3:45 PM, Marti Raudsepp <marti@xxxxxxxxx> wrote:
> On Tue, Feb 28, 2012 at 17:41, Daniele Varrazzo
> <daniele.varrazzo@xxxxxxxxx> wrote:
>> On Tue, Feb 28, 2012 at 2:15 PM, Marti Raudsepp <marti@xxxxxxxxx> wrote:
>>> On the Python end, you have to call psycopg2 connection.poll() method
>>> periodically or in response to select() activation
>>> There's an example here:
>>> http://initd.org/psycopg/docs/advanced.html#async-notify
>
>> Using an asynchronous IO-driven framework such as eventlet or gevent
>> you don't even need to poll the connection to look for events
>
> As mentioned above and as demonstrated in the example, select() also
> does the job. Using such a fancy framework is usually an overkill.

Yeah, the problem is usually if you have to do something else apart
from listening from the notification. select() will block the entire
application, so you would put it into a separate thread to have the
app running on. From here to start benefiting from eventlet the step
is very short. If a blocking behaviour is ok, then no problem using
bare select().

-- Daniele

-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux