is Event the best event loop module?
[email protected] (Danny Faught)
| Newsgroups | perl.loop |
|---|---|
| Organization | Tejas Software Consulting |
| Message-ID | <[email protected]> |
Greetings. I'm preparing a talk on event-driven programming in perl. I'll talk about some of the guts of event-driven programming, since most of my experiences were before any modules were available. But I've learned just enough about the Event module to demonstrate its use as well. Is Event the best choice to recommend for event-driven programming? I see that there's also the EventServer module - but given that it hasn't changed in a few years, can we assume that it's obsolete? I also see that POE looks like a viable choice. It seems to be more complex than Event, but perhaps a more powerful option? POE's revision is less than 1, though, so is it still beta quality? Also, I've tripped over some big signal concurrency issues looking at writing an event loop using a blocking select call. I'm used to only looking for signals, but adding IO and select makes it much more of a mess. I looked at the Event source to see how it deals with it. It appears that Event tries to be fail-safe by regularly polling the file descriptors rather than pausing in the poll or select call waiting for IO or a signal to happen. I can't tell how often it's called though (seems to be happening in the null_loops_per_second function). Can anyone confirm this analysis - does Event poll the file descriptors that it's watching? How efficient is the implementation? -- Danny Faught Tejas Software Consulting http://www.tejasconsulting.com