Guillermo Polito wrote
Announcements have other problems on their own, as we were talking with Pablo the other day. They are not reentrant (what happens if an announcement is raised during the treatment of an announcement? Does it loop?)
What? The new event is delivered, of course. If the complaint is "When I write an infinite loop using announcements, it is an infinite loop", I don't know what to tell you... Guillermo Polito wrote
, they block the caller until all announcements are processed (not so decoupled, huh :P),
Avoiding subscribers who take too long to process the subscription, *should* be the responsibility of each subscriber. If you think announcement overhead is bad now, imagine what happens if you fork of a process for every delivery. Depending on priority, you'd still have a problem in that it either in effect will still block the sender, or not be processed at all until sender completes. Also, good luck debugging. Show me *one* other event registration framework in a green-threaded system that hasn't made the same tradeoff, and I'll buy you a beer. Guillermo Polito wrote
right now without looking at the code it's not clear to me if they can handle the subscription of arbitrary instances instead of just Announcement (sub)classes (announcer on: arbitraryObject send: ...).
The fact you can easily search for users of a given announcement in a standard browser is one of its big advantages compared to the seaside announcements, if you ask me. However, the only hard requirement should be to implement handlesAnnouncement: on whatever is passed to when: (though, there seems to have been a late addition of #prepareForDelivery, which should be handled by announcement initialization, not the delivery mechanism, at least for the use indicated by its comment...). Which still doesn't make it a good idea to implement on arbitrary objects (though it's implemented on Symbol for backwards compatibility with the old event registration mechanism). Guillermo Polito wrote
Not even mentioning the weak/ephemeron mess :).
This I can get behind though, the world would be a better place if everyone unregistered their subscriptions properly. ;) (and/or we had a working ephemeron implementation without the same self-referential pitfalls as the weak one) Cheers, Henry -- Sent from: http://forum.world.st/Pharo-Smalltalk-Developers-f1294837.html