OpenFrame and Pipelines

james on 2002-02-22T12:05:56

I've just started rewriting OpenFrame to use my Pipeline module. It becomes stupidly easy.

Essentially OpenFrame->isa('Pipeline') and OpenFrame::Slot->isa('Pipeline::Segment'). OpenFrame::Response->isa('Pipeline::Production') and overrides the contains() method to return itself.

In order to make life really easy rather than having specific servers for apache, standalone, etc, etc, you will simple create a pipeline segment that takes an Apache object out of the store and returns a OpenFrame::Request. When you write your OpenFrame installation you take whatever the real server gives you and make sure you have a slot early on in your pipeline to convert it to something more useful. For example, an Apache handler would look like:

use OpenFrame; sub handler { my $r = shift; my $store = Pipeline::Store::Simple->new(); $store->set( $r ); my $pipe = OpenFrame->new( store => $store, segments => [ OpenFrame::Slot::ApacheRequest->new() ] ); $pipe->enter(); }

of course you'd probably want more segments, but the crux of it is there.

I think that we can probably have another slot, which parses the old config file, and adds a pipeline of the slots in the config file. Further more the OpenFrame::Slot::ApacheRequest could add a cleanup slot that outputs the production. Mad I say!

I think its nice anyway.