Re: NOTIFY in asynchronous mode - Mailing list psycopg

From Tobias Oberstein
Subject Re: NOTIFY in asynchronous mode
Date
Msg-id 634914A010D0B943A035D226786325D42D0C263C95@EXVMBX020-12.exch020.serverdata.net
Whole thread Raw
In response to Re: NOTIFY in asynchronous mode  (Jan Urbański <wulczer@wulczer.org>)
List 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()



psycopg by date:

Previous
From: Jan Urbański
Date:
Subject: Re: NOTIFY in asynchronous mode
Next
From: Fabian Knittel
Date:
Subject: RFC: Extend psycopg2.connect to accept all valid parameters?