
One of Catalyst's biggest strengths has also been one of it's biggest weaknesses for quite some time now.
The Catalyst::Engine modules are bindings to countless third party modules that allow you to run Catalyst on all kinds of servers.
Sadly these bindings are mostly just patchwork with all kinds of side effects.
You can't really blame the Catalyst developers for this because there are currently no better options available.
Especially LWP is not very good on the server side, even though it is an awesome client library.
This is where Mojo comes to the rescue, it provides basically everything below the dispatcher layer in a simple and reusable form.
You could call it a runtime environement for Perl web frameworks.
package MyApp;
use strict;
use warnings;
use base 'Mojo';
sub handler {
my ($self, $transaction) = @_;
my $response = $transaction->response;
$response->code(200);
$response->headers->content_type('text/plain');
$response->body('Hello World!');
return $transaction;
}
1;
As you can see, there is no dispatcher at all in Mojo, all you get is a handler method in your application class, similar to mod_perl.The Mojo core distribution contains four high quality server bindings that have been designed and rewritten from scratch, CGI, FastCGI, Daemon and Prefork Daemon.
All bindings are pure-Perl for portability reasons and have not a single prereq!
The next major release of Catalyst could already be running on Mojo, but i'll leave the final decision to the current Catalyst developers.
This was naturally just the tip of the iceberg, Mojo contains a full HTTP 1.1 stack and much more, but you should get the idea of what it's all about. :)
More about the individual Mojo components in my next article.