I'm experimenting with an event notification service based on a 
publish-subscribe model for some projects I'm working on.  When a 
subscription comes in, a 'Subscription' object is made, that 
basically looks like this:

class Subscription(Base):
     def __init__(self, subscriber, eventType, filter=None):
         self.subscriber = subscriber
         self.eventType = eventType
         self.filter = filter

     def __hash__(self):
         return hash(self.subscriber) & \
                hash(self.eventType) & \

'subscriber' is a reference to the subscribing object, and it's 
very likely to be to an object in the ZODB.  Is it wise to have 
more than one persistent reference to a single persistent object?  
I swear that I had once heard Jim say (vocally) that you could do 
references like this in the ZODB now.  I'm trying to avoid using 
Paths because objects have a tendency to move around[*], and I have 
performance concerns for a single event service object to have to 
call 'unrestrictedTraverse' to every subscriber.

[*] (it's due to the annoyances with manage_beforeDelete() and 
friends that
I'm writing this tool.)

Second question: If I use the hash of the Subscription as a key, is 
there any advantages/disadvantages with using an IOBTree to hold 
Subscription objects instead of a PersistentMapping?

Jeffrey P Shell, [EMAIL PROTECTED]

Zope-Dev maillist  -  [EMAIL PROTECTED]
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope )

Reply via email to