[Catalyst] Catalyst-Engine-JobQueue-POE

Kiki kiki at bsdro.org
Fri Sep 15 18:23:40 CEST 2006


Hi all,

I've commited version 0.0.1 of Catalyst::Engine::JobQueue::POE to the
catalyst repository.

The URL is
http://dev.catalyst.perl.org/repos/Catalyst/trunk/Catalyst-Engine-JobQueue-POE/

What's it about?

This engine is meant to be used by a separate process than the webserver
(an example can be found in t/testapp_jobqueue.pl) to schedule actions
to be executed at certain points in time (a al cron).

This is more a proof-of-concept implementation to see how things would
work out with POE and mst's idea of the execution mechanism. Therefore:

- there is no documentation (though the Engine is heavily inspired by
the HTTP::POE engine)
- the schedule is parsed from a crontab-like file (an example can be
found in t/crontab)
- there is no support for authz (but planned for a future version)
- the scheduling resolution is 1 minute
- no support for at-like jobs (one-time execution) (but planned for a
future version)
- uncaught exceptions cause the process to die silently (ex: not finding
a crontab file to parse)

Crontab syntax

Fields are whitespace separated
The first 5 fields are a standard cronspec (man 5 crontab)
The next field is a username (will be used for authz)
The next field is a URI (used for dispatching)
The rest of the fields are arguments (they are concatenated with '&' and
passed as QUERY_STRING)

How does it work?

The jobqueue process shares everything but the Engine with the main
catalyst application (Controllers, Models, Plugins, etc).

It uses POE::Component::Cron to schedule the jobs, which are then
provided with a CGI like environment to get a request built for them,
then the jobs are dispatched to the appropiate controller (based on the
URI from the crontab file). The missing parts of the request are filled
with default values ( CGI_ENV_DEFAULTS() in the module)

The output is rendered to the stdout by the engine. A status of 400+ or
0 causes the job to be remvoed from the execution queue.

As with C::E::HTTP::POE sending an USR1 signal to the jobqueue process
will cause it to dump state.

OK, that's about it
Let the feedback begin :)

Kiki



More information about the Catalyst mailing list