Joshua N Pritikin wrote: >What is the point of the Event::generic::Source class?
To allow any number of watchers to watch the same events. >It seems like there is only one really important method in the class -- >"event" to create a new event. So what I'm thinking is why not just add >this method to the generic watcher class? Wouldn't that simplify >things? If there were such a method only on the watcher class (it would be ->now(), but taking a data parameter), then to handle an arbitrary number of watchers for the same events I'd have to manually keep track of the watchers that should see a particular set of events, using weak references to avoid keeping watcher objects unduly alive. To generate an event I'd have to manually iterate through the watchers, checking which are active and generating events for those that are. In short, I'd have to implement Event::generic::Source, but I'd have to do it separately for each program and, due to doing it in Perl, less efficiently. So no, eliminating the event source class would not simplify things. If Event::generic::Source did not exist it would be necessary to invent it. -zefram