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-05 10:54:20
Message-ID: 634914A010D0B943A035D226786325D42D0C0CE424@EXVMBX020-12.exch020.serverdata.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: psycopg

-- Original message -----
> > What would be provided to the callback?
> >
> > Channel (from NOTIFIY), Payload (from NOTIFIY), Connection (txpostgres)
> ?
>
> Probably simply the psycopg2 Notify object.

Ok, fine also.

And not the Connection object on which it was received? Ok, maybe it's
not needed: When I want to do some db stuff within the callback, should
not make a difference on what connection I do that.

Few other design Qs:

Is it possible to UNLISTEN?

Or unregister a callback on a channel? Or set it to None?

Are callbacks for channels registered "globally" or per connection?

Can there be only one callback at most registered per channel?

In response to

Responses

Browse psycopg by date

  From Date Subject
Next Message Jan Urbański 2011-11-05 11:51:46 Re: NOTIFY in asynchronous mode
Previous Message Jan Urbański 2011-11-05 10:47:37 Re: NOTIFY in asynchronous mode