Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

Matts (1087)

  (email not shown publicly)

I work for MessageLabs [] in Toronto, ON, Canada. I write spam filters, MTA software, high performance network software, string matching algorithms, and other cool stuff mostly in Perl and C.

Journal of Matts (1087)

Wednesday September 01, 2004
09:05 AM


[ #20671 ]

Yesterday during a quiet moment at the MSFT bash I was at I decided that I would like to see if it was possible to write a framework that had an event loop (a-la poll()/select()/epoll) yet could be made to run in either completely event-based mode (i.e. all flow control is in the event loop itself) - a "push" model where events get pushed to you, or a "pull" mode, where you ask for lines from the socket (like while (<$sock>) { process_line($_) }) and process them one by one.

It worked. I used livejournal author Brad Fitzpatrick's Danga::Socket module (which implements either a poll() or epoll event loop depending on what is available on the host platform) and managed to design a framework that could do this. It's about 150 LOC so I won't post it here.

So now what's left to do is think about how I can integrate this into qpsmtpd so that I can have a completely event based system that works in both tcpserver mode and pure-event-based mode. Lots more work, but an interesting project nonetheless.

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.