?

Log in

No account? Create an account
IO::Epoll - brad's life — LiveJournal [entries|archive|friends|userinfo]
Brad Fitzpatrick

[ website | bradfitz.com ]
[ userinfo | livejournal userinfo ]
[ archive | journal archive ]

IO::Epoll [Apr. 17th, 2004|12:58 pm]
Brad Fitzpatrick
[Tags|, ]

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%. :-/
LinkReply

Comments:
From: iralia
2004-04-17 01:03 pm (UTC)
hola!
(Reply) (Thread)
From: kw34hd1
2004-04-17 03:43 pm (UTC)
APC has these neat bags (travelpower, i think they're called) that accept input voltage at 110VAC (wallcurrent), 12VDC (car), and whatever that weird voltage is that they give you on airplanes. it has a changeable plug on the input end to plug into any of those three sockets.

output is variable 15-20VDC and includes a bunch of changeable plugs for every kind of laptop out there.

it also gives a bunch of powered usb ports, the idea being that you then buy the appropriate usb->pda and usb->phone cables from APC and it charges all of your gizmotrons from wherever you have a plane, wall, or lightersocket hookup.

of course, it doesn't have the plug for my compaq laptop (presario 2570us) so i can't use the one they gave me as a promo. if you want it, i'll mail it to you.

-j
(Reply) (Thread)
[User Picture]From: brad
2004-04-18 09:48 am (UTC)
There's power available on airplanes!?
(Reply) (Parent) (Thread)
From: kw34hd1
2004-04-18 01:49 pm (UTC)
yeah, usually...

http://support.gateway.com/support/manlib/Notebooks/Updates/8504822/04822.htm

although according to this, it doesn't look good for coach:

http://zurich.csail.mit.edu/hypermail/thinkpad/2000-01/0283.html

http://amos2.catalogcity.com/cc.amos?main=catalog&ccsyn=260&pcd=8710514&ccsid=218971211-16413&_ccn_test=1

apparently the airplane power plug is called "EmPower".

my offer on the apc travelpower case+brick stands, as it doesn't have the output connector for my laptop and selling it on ebay is too much of a hassle.

-j
(Reply) (Parent) (Thread)
[User Picture]From: grumpy_sysadmin
2004-04-18 05:24 pm (UTC)
You're obviously still flying "economy". C'mon, take first class, and give the jerks one more "Why is my paid subscription paying for this?!?" point. ;^>
(Reply) (Parent) (Thread)
[User Picture]From: adamthebastard
2004-04-19 06:56 am (UTC)
"and wrote a chat server" just the server and no client? Maybe you are going to palm that off onto evan (linky) or one of your other minions. Of course you could just leave it as vaporware but how does the community benifit from that?
(Reply) (Thread)
[User Picture]From: brad
2004-04-19 08:39 am (UTC)
The client was telnet.

It was just a proof-of-concept. The community will benefit from the final product (a reverse web proxy)
(Reply) (Parent) (Thread)
From: evan
2004-04-19 10:27 am (UTC)
yeah, 'cause what the world really needs is one more irc client. ;)
(Reply) (Parent) (Thread)