[MTOS-dev] TheSchwartz vs MT::TaskMgr
Mark Paschal
mark at sixapart.com
Wed Apr 2 08:38:22 PDT 2008
Jay Allen wrote:
> Oh wait, I see, you're saying the opposite! That is MT::TaskMgr is
> still being used for small periodic tasks while, on the other hand,
> the bigger jobs like republishing moved over to TheSchwartz. Do you
> know if it's expected to remain like that or alternately whether there
> is any plan to migrate the remaining tasks over to TheSchwartz and
> either do away with MT::Task/MT::TaskMgr or to merge them with
> MT::TheSchwartz?
TheSchwartz is designed for one-time tasks, in that it doesn't provide
a way for jobs to recur. We could simulate it by always replacing
recurring jobs with the next scheduled run, instead of "finishing"
them as with one-time jobs, but it still sounds fragile. Code that
unintentionally marks a recurring job as completed or a database fault
of some kind could derail a job *and* its future occurrences.
OTOH, it would be nice to use TheSchwartz exclusively to do work.
If we did use TheSchwartz for scheduled tasks, we would probably have:
* a Schwartz job that performs generic MT::Tasks, and
* an MT::TaskMgr that still has the scheduling logic, but queues
Schwartz jobs instead of performing MT::Tasks directly.
I expect we'd keep the existing APIs for defining scheduled tasks,
even if we use TheSchwartz to do them.
We have not scheduled any work (heh) in this area, afaik.
Mark Paschal
Software developer, Movable Type
mark at sixapart.com
More information about the MTOS-dev
mailing list