Google App Engine拉入队列按FIFO顺序返回任务吗? [英] do google app engine pull queues return tasks in FIFO order?

查看:50
本文介绍了Google App Engine拉入队列按FIFO顺序返回任务吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

google app引擎提取队列是否按任务到达时间的FIFO顺序返回任务?

Do google app engine pull queues return tasks in FIFO order of their arrival time?

我在提取队列文档中阅读了以下内容:

I read the following in the pull queue documentation:

"API按照最早的任务ETA的顺序返回指定数量的任务."

"the API returns the specified number of tasks in order of the oldest task ETA."

ETA =预计到达时间",在这种情况下,我对此并不完全了解.

ETA = "Estimated time of arrival", which I don't fully understand in this context.

我正在尝试使用python按任务在队列中的到达时间来获取任务.

I'm trying get tasks in order of their arrival time in the queue with python.

推荐答案

队列中的每个任务都有一个ETA,默认情况下设置为该任务入队的时间.但是将来(甚至过去)可以使用ETA来排队处理任务.来自 google.appengine.api.taskqueue包,在taskqueue.add()参数之间:

Each task in the queue has an ETA, by default set to the time when the task in enqueued. But it's possible to enqueue tasks with an ETA in the future (or even in the past). From google.appengine.api.taskqueue package, in between taskqueue.add() arguments:

  • 倒数-将来运行或租用此任务的时间(以秒为单位).默认为零.如果不指定此参数 您指定了eta.

  • countdown -- Time in seconds into the future that this task should run or be leased. Defaults to zero. Do not specify this argument if you specified an eta.

eta-一个datetime.datetime,它指定任务应运行的绝对最早时间.您不能在以下情况下指定此参数 指定了倒数计时参数.这个说法可以是时间 时区感知或未时区,或设置为过去的时间.如果 参数设置为无,默认值为现在.对于拉任务,否 工人可以在eta指示的时间之前租用任务 论点.

eta -- A datetime.datetime that specifies the absolute earliest time at which the task should run. You cannot specify this argument if the countdown argument is specified. This argument can be time zone-aware or time zone-naive, or set to a time in the past. If the argument is set to None, the default value is now. For pull tasks, no worker can lease the task before the time indicated by the eta argument.

只要在排队任务时不使用这些参数覆盖默认的ETA,它们就会以FIFO顺序拉入.

As long as you don't overwrite the default ETA by using these arguments when enqueueing tasks they will be pulled in FIFO order.

这篇关于Google App Engine拉入队列按FIFO顺序返回任务吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆