app = Celery('tasks', backend='amqp', broker='amqp://')
Or if you want to use Redis as the result backend, but still use RabbitMQ as the message broker (a popular combination):
app = Celery('tasks', backend='redis://localhost', broker='amqp://')
=========
Redis 命令行结果
127.0.0.1:6379> keys *
1) "emails"
2) "mmtest"
3) "_kombu.binding.celery"
4) "_kombu.binding.celeryev"
5) "celery-task-meta-f418abea-7827-4220-b72e-a0669e8b8a08"
6) "celery-task-meta-43105310-a8e2-483b-bd8a-8a54affc9192"
7) "_kombu.binding.celery.pidbox"
8) "name"
9) "unacked_mutex"
10) "email"
11) "mygmail"
12) "myyahoo"
如何产看redis里面的存储内容?
This can actually be considered a Redis problem.
Use the
type
command to view the corresponding data type, and then use other commands to view the contentFor example, for the most basic key value, use
get $key
即可。对于list
,使用lrange
(由于是拿一个范围,需要先用llen
to get the length as parameter).Of course, it is also possible to call the relevant commands of the Redis client under Python.
You can let Celery save the task execution results. Please refer to the result-related settings below.
http://docs.celeryproject.org...
result_backend
result_cache_max
result_compression
result_exchange
result_exchange_type
result_expires
result_persistent
result_serializer
As for the viewing method, in addition to directly browsing in the corresponding backend, you can also use flower