Em Terça 16 Maio 2006 19:40, Jorge Vargas escreveu:
> database? why does cron depends on a db?
In this case, for persistence of information. But I believe that this should
not be a dependency but some kind of extra feature. I also believe that
putting these scheduled events inside a database isn't hard.
I have been looking in that code the whole day the actual tasks are just plain objects store in a list call queue, inside the python sched module I'm sure they can be pickle and unpickle to have persistency.
Although if you have the schedulers at module lvl it wont really make a big diference...
I have been thinking of this the whole day and both ways will collide, since having a task at module lvl will add up many task to the persistent object, and since they are not eliminated each time the server starts one extra task will be created, for this I was thinking adding an attibute to the Task class that will make it a
"persistent" task or not.
on the other hand I was thinking adding some methods to the module
- list all current tasks
- get one task object from that list
- cancel all Tasks
Make it useful to run from tg-admin shell
and modify both start/stop to do the pickle/unpickle of the tasks and start will have to reschedule all the task at startup (kind of a batch)
- plus two trivial
- ones that will schedule a task to run each day at a given time, a convinience method to calling add_weekday_task with all 7 days
- one that will let you run a task starting at a given time and then in intervals, little modification of add_inverval_task
--
Jorge Godoy <[EMAIL PROTECTED]>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/turbogears
-~----------~----~----~----~------~----~------~--~---

