def rtask_save_proc(task=None):
import os
import tempfile
# save data in /tmp/tickdata
with open(os.path.join(os.sep, tempfile.gettempdir(), 'tickdata'), 'w') as fd:
while True:
i, n = yield task.receive()
if n is None:
break
fd.write('%s: %s\n' % (i, n))
raise StopIteration(0)
# This task runs on client. It gets trend messages from remote task that
# computes moving window average.
评论列表
文章目录