import chalk from tiempo.execution import thread_init from tiempo.task import Task @Task(priority=1, periodic=True, force_interval=1) def something(): chalk.red("something") thread_init() from twisted.internet import reactor reactor.run()
from tiempo.execution import thread_init from .utils.loader import auto_load_tasks thread_init() auto_load_tasks()
def ready(self): if not 'runtiempo' in sys.argv: print 'initing tasks' thread_init(executable_path="%s/manage.py"%os.getcwd(), args=['runtiempo']) auto_load_tasks()