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

Kiffin Gish kiffin.gish at planet.nl
Thu Mar 25 15:49:42 GMT 2010


I believe that what Ido is trying to get at is the fact that the
triggered actions are not completely independent of the application.

Putting them in crontab is fine for running processes at predictable
times, but this is no good if the application needs some kind of control
over them.

Hooking them up to only occur when triggered by HTTP requests should not
be a limitation (reminds me of the good old days programming Windows and
hoping for cooperative yielding to pass me a WM_PAINT message in time).

Catalyst is a very flexible and therefore powerful framework, so let's
use it this way.

On Thu, 2010-03-25 at 10:32 -0500, Peter Karman wrote:
> Ido Perlmuter wrote on 03/25/2010 10:04 AM:
> > Kiffin, thanks for the heads up about Plugin::Scheduler, seems to fit my
> > needs quite good.
> >
> 
> > Starting an external worker that needs to connect to the schema and
> > try hard to figure out what's going on in the already running Catalyst
> > process is pointless, hard to implement and kinda ugly (in my opinion).
> 
> I won't argue with the ugly part, since taste is personal, but if it is
> hard to connect to the schema and start background processes, I suspect
> your application architecture needs a re-think. Catalyst is for gluing
> HTTP onto an application. If you're doing more than that, the
> architecture needs reconsideration.
> 
> > My app is already up and
> > running, why start a new process? it's those idle moments when nobody
> > seems to visit my stupid websites that I want the app to employ itself
> > with some useful tasks.
> 
> Scheduler is triggered on requests. So by definition your app is not idle.
> 
> Bill's point is that if you have non-HTTP request cycle actions as part
> of your business model, they don't belong in your Catalyst app. That
> doesn't mean you can't reuse parts of the code in your Catalyst app, but
> that the Catalyst engine itself doesn't need to be involved.
> 
> cron is your friend.
> 


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




More information about the Catalyst mailing list