Hi Daniel, that sounds excellent!
I'd be really interested to see more of this - I got as far as
implementing the server side using the OpenMarket code as a base, but
started to feel I would have to do some significant reworking. Sounds
like you've already done that and more.
What's your take on multiplexing connections?
Bests
Igor
On 11 April 2008, at 06:11, Daniel Wirtz <[EMAIL PROTECTED]> wrote:
I'm currently taking a deeper look into FastCGI on top of mina. I
built the basic FCGIEncoder, FCGIDecoder and a FCGICodecFactory with
performance in mind mostly using IoBuffers and stripping all the
needless stuff the original 12 years old devkit contains.
Connections can be used in both directions as client and/or server
and there are two modes implemented: A simple responder model
utilizing FCGIRequest and FCGIResponse that can be easily sent and
later on received by an IoHandler bypassing all the low level stuff
by pre-assembling FCGIPackets and also a low level mode to send and
receive custom FCGIPackets on your own (maybe for authorizer mode,
you can even mix). I'm currently working on a simple FCGIManager to
easily spread requests over multiple FastCGI backends - had this
working once with a good ol' threading model but then I decided to
implement it completely on top of Mina with a similar overall
structure like AsyncWeb. Think it would be a nice option to use PHP,
Ruby etc. backends for processing arbitrary stuff (quite similar to
mod_fastcgi in Apache and lighttpd).
FCGIRequest request = new FCGIRequest();
request.setProperties(....); request.setStdin(...);
session.write(request); -> messageReceived(...) retuns FCGIResponse
containing Stdout, Stderr byte arrays + AppStatus, ProtocolStatus,
RequestId etc. or alternatively a low level FCGIPacket depending on
the CodecFactory setting (e.g. new
FCGICodecFactory(FCGIPacket.class / FCGIResponse.class /
FCGIRequest.class)).
Tested it with PHP, works fine so far.
Is there already a good FastCGI implementation available or is there
still a need for one?
--
Igor Clark • POKE • 10 Redchurch Street • E2 7DD • +44 (0)20 7749 5355
• www.pokelondon.com