推VS在谷歌App Engine的拉取队列 [英] Push vs Pull Queues on Google App Engine

查看:139
本文介绍了推VS在谷歌App Engine的拉取队列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

到目前为止,没有人(甚至没有GAE文档)已经能够给我的差异是一个队列和之间什么是真正的清楚描述拉队列。

So far, no one (not even the GAE docs) has been able to give me a really clear description of what the difference is between a push queue and a pull queue.

我的了解的是,任务队列API允许你定义任务队列在那里工作可以排入到。不知怎的,这一点也适用GAE的自动缩放功能,使您无需显式管理的工作线程消耗掉这些队列的任务​​数:GAE只是它为你

My understanding is that the Task Queue API allows you to define task queues where work can be enqueued to. Somehow, this works with GAE's auto-scaling feature so that you don't need to explicitly manage the number of worker threads consuming tasks off these queues: GAE just does it for you.

但无处我能找到推之差的国王的英语的描述和拉队列。什么是推送队列推?什么是拉入队列揪?难道他们都配置在 queues.xml

But nowhere can I find a "King's English" description of the difference between push and pull queues. What is a "push queue" pushing? What is a "pull queue" pulling? Are they both configured inside queues.xml?

推荐答案

在一个拉入队列您排队任务到队列中,您的code需要拉他们,您可以通过租赁拉他们从队列和删除任务的任务。如果不删除该任务和租约时间已过期,系统将返回任务回到队列。

In a pull queue you enqueue tasks into the queue and your code needs to pull them, you pull them by leasing tasks from the queue and deleting the tasks. if you don't delete the tasks and the lease time is expired the system will return the tasks back to the queue.

您可以使用拉入队列(例如)聚合,可以一起处理多个工作单位。又如:排队任务将由外部机器进行拉(如EC2或gCompute),以处理该任务的方式,应用引擎不能。

You can use pull queue (for example) to aggregate a multiple work units that can be processed together. Another example: queuing task that will be pull by an external machine (like EC2 or gCompute) in order to process the task in a manner that AppEngine can't.

推队列您排队任务到队列中,但会的AppEngine他们出列,将通过任务指定的处理程序运行它们。您可以控制​​任务的处理速度,如何控制任务执行失败和AppEngine上会决定有多少实例(线程),以TODO加工使用。

In push queue you enqueue tasks into the queue but AppEngine will dequeue them and will run them on the handler specified by the task. You can control the task processing rate, how to control task execution failures and AppEngine will decide how many instances (threads) to use todo the processing.

这篇关于推VS在谷歌App Engine的拉取队列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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