[Catalyst] Taking advantage of idle periods by performing some action(s)

Kiffin Gish kiffin.gish at planet.nl
Thu Mar 25 13:12:48 GMT 2010


Check out Catalyst::Plugins::Scheduler for some ideas.

On Thu, 2010-03-25 at 14:30 +0200, Ido Perlmuter wrote:
> Hi everyone.
> 
> 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.
> 
> The idea is, basically, to define a situation in which your app can be
> considered idle (no requests in the past 3 minutes, only 2 requests
> per minute, I don't know), and then forcing the app to maybe create a
> fake request to a Private action that does whatever it is I want. It
> might also be necessary to force the action to "break out early" in
> case the app starts receiving more requests and can no longer be
> considered idle.
> 
> 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.
> 
> Any help will be appreciated, I still can't think of a way to do this.
> 
> Thanks a lot,
> Ido.
> 
> _______________________________________________
> List: Catalyst at 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/


-- 
Kiffin Gish <kiffin.gish at planet.nl>
Gouda, The Netherlands




More information about the Catalyst mailing list