该文档很少介绍该priority属性。其中一种罕见的文档参考内容是:
priority (int): The task priority, a number between 0 and 9.
Defaults to the :attr:`priority` attribute.
Run Code Online (Sandbox Code Playgroud)
(参考:http : //docs.celeryproject.org/en/latest/_modules/celery/app/task.html#Task.apply_async)
但是,如果转到以下页面的底部-http : //docs.celeryproject.org/en/latest/userguide/calling.html-您将看到:
优先级0到255之间的数字,其中255是最高优先级。
支持者:RabbitMQ,Redis(优先级颠倒,最高为0)。
这两条信息是矛盾的。此外,我认为文档字符串是最新的...
问题是哪一个是相关的,更重要的是:优先级如何排序-优先级= 0意味着最高优先级?还是取决于后端,就像文档页面上说的那样...
我也为此做了一个GitHub问题-https: //github.com/celery/celery/issues/4599
更新1:我在v4.0的kombu更改日志(http://docs.celeryproject.org/projects/kombu/en/latest/changelog.html)中找到以下内容:
Redis:优先级0现在是最低,9是最高。(向后不兼容)
这与AMQP中优先级的工作方式相匹配。
修复由Alex Koshelev提供。
| 归档时间: |
|
| 查看次数: |
560 次 |
| 最近记录: |