Oct. 30, 2012
5:36 a.m.
Yury Selivanov wrote:
It would be even better if we can return a tiny wrapper, that lets you to simply write 'doit.run().with_timeout(2.1)', instead of:
task = scheduling.Task(doit(), timeout=2.1) task.start() scheduling.run()
I would prefer spelling this something like scheduling.spawn(doit(), timeout=2.1) A newly spawned task should be scheduled automatically; if you're not ready for it to run yet, then don't spawn it until you are. Also, it should almost *never* be necessary to call scheduling.run(). That should happen only in a very few places, mostly buried deep inside the scheduling/event loop system. -- Greg