[Catalyst] [RFC] C::P::Scheduler - cron-like scheduling of events
adam at herzogdesigns.com
Tue Dec 13 02:39:45 CET 2005
On Dec 11, 2005, at 11:01 PM, Andy Grundman wrote:
> I have a need for a simple scheduling plugin to do things like clean
> up database sessions, so I roughed out docs for a new plugin called
> Scheduler. If you've got any thoughts or suggestions, please let me
> know. :)
Sounds like a great idea that a lot of people are looking forward to...
I have an app that I'm working on for a customer which has a handful of
different cron-type tasks that need to be performed: email reports,
clear old db data, remove old thumbnails, create new ones, etc, etc.
The app is for a specific customer, but they'd eventually like to be
able to distribute it to other organizations easily.
In an effort to allow flexibility without complication, I'd been
thinking (until this thread started) that what I was going to write a
quick interface which would allow the administrator to choose which
time(s)/how often each task would run, and I'd store that in a file or
db somewhere. Then, there would be a cron which wget'd
http://www.myapp.com/admin/cron (or something like that) every 30
minutes or so, and the app would manage executing the individual tasks
if necessary. That would also let me log in the database the success or
failure of the tasks, and the user can easily adjust the schedule of
events (since they generally aren't familiar with cron, or anything
I guess that was a lot of background to basically ask this:
This plugin would definitely help with that, provided that I could
access the schedule (to display it to the user) and change the schedule
without having to restart the app.
> Events which consume a lot of time will slow the request processing
> for the
> user who triggers the event. Long-running tasks should not be
> scheduled using
> this plugin.
In regards to this, is the only problem that the request will take a
long time? Some of the events may be long running, but if it was
executed on the requests from the system cron, then I don't care. So,
would/could it be possible to have the scheduler only run if a specific
controller or path were requested? Or, perhaps, only for requests from
a certain IP (ie localhost)...
I'd prefer to keep just a single, simple line in the system cron and
manage as much as possible through the app itself...
Any thoughts on whether the plugin would be useful, or I should just
roll my own? Any thoughts in general?
More information about the Catalyst