[Zope3-dev] Re: Object Hub does not receive important events

Gary Poster gary@zope.com
Wed, 09 Jul 2003 09:01:54 -0400


Jim Fulton wrote:
> Stephan Richter wrote:
> 
>> Hi Gary,
>>
>> I was just trying to test the text index by having it filled using the 
>> ObjectHub and a Registration subscriber. After I figured out that the 
>> service name "EventSubscription" changed to "Subscription" (see 
>> checkins), I got the Registration subscriber to work and was able to 
>> add new objects to the hub and therefore to the index.
>> Then however, I tried to modify and delete objects, but the 
>> ObjectModifiedEvent and ObjectRemovedEvent are not being forwarded to 
>> the Object Hub, so nothing happens.
>>
>> As far as I can tell, there are two possible ways of fixing this:
>>
>>   1. Subscribe the object hub directly to the two events.
>>
>>   2. Have the Registration subscriber handle the two events.
>>
>> If I visualize the design correctly in my head, I think option 2 would 
>> be the correct one, since it seems to me that the "Registration 
>> subscriber" is responsible for automatically managing the hub based on 
>> events.
> 
> 
> I don't think that that's correct. I'm 99% sure that the hub is supposed
> to be subscribed to modification and removal events.
> 
> See zope/app/interfaces/services/hub.py.
> 
> Ah, and see zope/app/services/hubcollaborations.txt.
> 
> Clearly, the hub is supposed to handler adds and removes.
> 
> There seems to be a special case for objects moved into or out
> of the hubs place, but, frankly, copying and moving are a mess right
> now and I would ignore them for this discussion.
> 
> I'm puzzed that the hub isn't registered for modified and removed
> events. I guess this is partly the result that we aren't using it. :(

Hi.  Sorry for the slow response time: I'm a bit overbooked. :-)  I have 
only been following a small subset of Zope 3 lately, so I don't have 
much to add except to say that what Jim says is certainly what I 
originally expected...but I'm completely unaware of the "Registration 
subscriber" machinery.

Gary