Application change notification

Jim Fulton <[email protected]>
Newsgroups gmane.comp.web.zope.zodb
Message-ID <CAPDm-FhTP=vzzLVTDDbR-9aZh_8q6qCm33wCK8o+CiXg41ZP+g@mail.gmail.com>
In implementing "real-time" UIs, where you want to update a user's view of
information due to actions by other users, you need some way of notifying
users when objects have changed.
This is a feature that I've wanted to add to ZODB for some time.  Until
ZODB 5, it would have been extremely easy to add. So easy, in fact, that
when I needed it I added it via monkey patching. :-|

With the switch to MVCC, however, it's become a bit trickier.  Here are
some thoughts:

   - At the application level, the ZODB.DB class grows a subscribe method:

     subscribe(callback)

   The callback will be called with a sequence of object ids that have
   changed.

   The subscribe method may be called more than once to register multiple
   subscribers.

   Subscribers may be called more frequently than there are actual changes.
    (This is to make a potential RelStorage implementation a little simpler.)

   - A new storage interface, IMVCCNotify will provide a subscribe method
   like the one above, except that it will never be called more than once, so
   the storage need not support multiple subscribers.
   - These interfaces will be implemented for DB and the built-in MVCC
   adapter used for traditional non-MVCC storages.
   - The subscribe method might be implemented for RelStorage, but
   notifications might be sent late, when a client polled for changes
   - I plan to implement this for Newt DB using a database trigger to get
    notifications sent in real time.

Thoughts?

Jim

-- 
Jim Fulton
http://jimfulton.info

-- 
You received this message because you are subscribed to the Google Groups "zodb" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
For more options, visit https://groups.google.com/d/optout.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.