pyList

一个可替换Celery方案的Task 库

因为Celery 太慢,tasktiger 基于redis

一个可替换Celery方案的Task 库

使用很简单:

定义任务

# tasks.py
def my_task():
    print 'Hello'

使用 delay 方法

import tasktiger, tasks
tiger = tasktiger.TaskTiger()
tiger.delay(tasks.my_task)

开启进程:

% tasktiger
{"timestamp": "2015-08-27T21:00:09.135344Z", "queues": null, "pid": 69840, "event": "ready", "level": "info"}
{"task_id": "6fa07a91642363593cddef7a9e0c70ae3480921231710aa7648b467e637baa79", "level": "debug", "timestamp": "2015-08-27T21:03:56.727051Z", "pid": 69840, "queue": "default", "child_pid": 70171, "event": "processing"}
Hello
{"task_id": "6fa07a91642363593cddef7a9e0c70ae3480921231710aa7648b467e637baa79", "level": "debug", "timestamp": "2015-08-27T21:03:56.732457Z", "pid": 69840, "queue": "default", "event": "done"}

项目地址 https://github.com/closeio/tasktiger 14

本文标签: Celery Task 替换 方案 一个
本文网址: https://pylist.com/t/1453116610 (转载注明出处)
如果你有任何建议或疑问可以在下面 留言
发表第一条评论!
验证码图片
相关推荐