On Thu, Mar 25, 2010 at 5:30 AM, Ido Perlmuter <i...@ido50.net> wrote:

> I'm looking for direction on how to possibly implement a feature in a
> Catalyst app that automatically performs some action, or actions, when the
> app is idle and hasn't been accepting requests (either none or some small
> number). For example, let's say I want my app to take advantage of such
> situations by indexing documents to KinoSearch, rebuilding a sitemap.xml
> file, whatever.
>

Doesn't really seems like the job of a Catalyst app to run background tasks.

What's wrong with cron?  It can run a script and see if the machine's load
is low (or some other measurement) before deciding to run.



> Thing is, I do not want (if possible) to implement a job queue such as
> TheSchwartz. I do not want an outside worker, I want my app to be the
> worker, and let it decide by itself what to do instead of take jobs from a
> queue.
>

Yes, you do want an outside worker.  It can be part of  your app, but it
should be separate from Catalyst.  Put it in a model class.  Ok, sure you
could have cron run App/script/app_test.pl /path/to/action but why load all
of Catalyst just to run some code in your application?




-- 
Bill Moseley
mose...@hank.org
_______________________________________________
List: Catalyst@lists.scsys.co.uk
Listinfo: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/catalyst
Searchable archive: http://www.mail-archive.com/catalyst@lists.scsys.co.uk/
Dev site: http://dev.catalyst.perl.org/

Reply via email to