Skip site navigation (1) Skip section navigation (2)

Re: NOTIFY in asynchronous mode

From: Tobias Oberstein <tobias(dot)oberstein(at)tavendo(dot)de>
To: Jan Urbański <wulczer(at)wulczer(dot)org>, Daniele Varrazzo<daniele(dot)varrazzo(at)gmail(dot)com>
Cc: "psycopg(at)postgresql(dot)org" <psycopg(at)postgresql(dot)org>
Subject: Re: NOTIFY in asynchronous mode
Date: 2011-11-09 18:53:32
Message-ID: 634914A010D0B943A035D226786325D42D0C263C95@EXVMBX020-12.exch020.serverdata.net (view raw or flat)
Thread:
Lists: psycopg
> > Doh, sorry if I made it too easy. It would be great if notifies could
> > be used easily from Twisted: they seem made for each other like bread
> > and nutella. Please keep us informed if you manage to add the support
> > to the library.
> 
> No problem ;) I think it was just what I needed to add support for NOTIFY to
> txpostgres, which is now present in HEAD.
>

very nice. thanks!

btw: just tested .. it works with the revived kqueue reactor on FreeBSD

https://github.com/oberstet/txkqreactor

from txkqreactor import kqreactor
kqreactor.install()

from twisted.internet import reactor

from txpostgres.txpostgres import ConnectionPool, Connection

def observer(notify):
   print "NOTIFY", notify

conn = Connection()
conn.addNotifyObserver(observer)
d0 = conn.connect(DSN)
d1 = d0.addCallback(lambda res: conn.runOperation("LISTEN test"))

print "reactor class", reactor.__class__
reactor.run()


In response to

psycopg by date

Next:From: Fabian KnittelDate: 2011-11-16 17:56:46
Subject: RFC: Extend psycopg2.connect to accept all valid parameters?
Previous:From: Jan UrbańskiDate: 2011-11-06 20:54:42
Subject: Re: NOTIFY in asynchronous mode

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group