def launch(func, params=[]): t1 = stackless.tasklet(func)(*params) tasklets[t1] = 'atom://localhost/' + func.__module__ + '/' + func.__name__ while t1.scheduled: stackless.schedule() sleep(0.01)
def serve_forever(func, params=[]): t1 = stackless.tasklet(func)(*params) tasklets[t1] = 'atom://localhost/' + func.__module__ + '/' + func.__name__ while True: stackless.run() sleep(0.01)