예제 #1
0
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()
예제 #2
0
파일: models.py 프로젝트: vepkenez/tiempo
from tiempo.execution import thread_init
from .utils.loader import auto_load_tasks

thread_init()
auto_load_tasks()
예제 #3
0
 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()