Brad Fitzpatrick (brad) wrote,
Brad Fitzpatrick
brad

IO::Epoll

I played with IO-Epoll-0.01 (epoll wrappers for Perl) on the plane and wrote a chat server, using the same style as memcached: single-threaded, event-based (state machine), all non-blocking IO, etc.

It was like 100 lines, too. So damn cool.

So now I'm thinking writing a reverse proxy with buffering in Perl would be damn easy, including the internal redirect stuff. The only hard part there is I'm not sure how to do non-blocking reads from a file.... I seem to recall that was ugly for some reason? If I'm limited to sockets, I suppose I could have a helper process doing blocking file IO and relaying it back over a socket.

Then I'll write a libevent-like layer on top to let people pick IO::Epoll or IO::Poll, or kqueue if it there are perl bindings.

How does this effect monobal? Who knows. But at least knowing how feasible this is in Perl, I can bang out a prototype in no time (much faster than my relatively slow C#) and test its speed and test features before the perl version is continued in C# or C.

Damn, boarding to Portland in 10 minutes and my battery has only charged up to 18%. :-/
Tags: perl, tech
Subscribe
  • Post a new comment

    Error

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

    When you submit the form an invisible reCAPTCHA check will be performed.
    You must follow the Privacy Policy and Google Terms of use.
  • 8 comments