On Tuesday, November 1, 2016 at 2:42:28 PM UTC-7, mweissen wrote: > > I want to start a task from a module. (The module contains a small > smtp-server.) > I could it with a db.scheduler_task.insert(...), but I want to use > myschedule.queue_task(...) > > What would be the correct way to define "myschedule" ? Something like > > myschedule = Scheduler(current.db) > > > Regards, Martin >
My first thought is that you define myschedule in your model file(s), and then in whatever controller calls your module, add it to current and pass it that way, or make it an argument of your module's function. I don't see any reason NOT to use queue_task, and inserting directly into the table is subject Change Without Notice. /dps -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.

