一个可替换Celery方案的Task 库

pylist 30048

因为Celery 太慢,tasktiger 基于redis

使用很简单:

定义任务

# 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 6

登录发表评论

桂公网安备 45122402000014号