Interesting how many people in this list think that "Announcer subclass: #TxEditor" provides special implementation of announcer named TxEditor?Many�this is composition using inheritance and inheritance should not be used like that.�Announcer subclass: #GreedyAnnouncerAnnouncer subclass: #RemoteAnnouncer
Announcer>>subscribe: anAnnouncementClass do: aValuable�"Declare that when anAnnouncementClass is raised, aValuable is executed."^ registry add: (AnnouncementSubscription new�announcer: self;announcementClass: anAnnouncementClass;valuable: aValuable)
All magic happens inside #add: and #deliver: methods of SubscriptionsRegistry.Announcer>>announce: anAnnouncement| announcement |announcement := anAnnouncement asAnnouncement.registry ifNotNil: [registry deliver: announcement].^ announcement
Without subclassing YourEventsSource from Announcer you will not have such feature. Or you will need implement complex subscription method inside YourEventSource which will delegates special event handler to its announcer�announcer on: MyEvent send: #handleAnnouncement:raisedBy: to: aSubscriber