本文介绍了如何以编程方式创建&暂停Google App Engine任务队列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的是Google App Engine,并且我一直使用命名推送队列来处理一些任务。队列是使用queue.xml定义和配置的。这很好。



现在我正在努力做更多:



有没有办法在Java中的一个新的队列

2)另外,一旦我有一个队列(通过队列。 xml或1)如果可能的话),有没有办法在Java中暂停和恢复队列(就像你可以使用管理控制台按钮一样)?



谢谢!

解决方案

由于它必须位于queue.xml中并且与您的应用一起上传,我想不出办法做到这一点。正如所述:应用程序只能将任务添加到队列中定义在queue.xml和默认队列中。



2)在同一页面中,只有一点,您可以看到如果将处理速率设置为0,它将暂停您的队列。要恢复,只需将其更改回其他地方即可。不幸的是,所有这些都是通过xml完成​​的,而不是通过代码直接完成的。



您可能希望将其添加到Google的作为功能请求。


I'm using Google App Engine and I've been using a named push queue to process some tasks. The queue was defined and configured using queue.xml. That's fine.

Now I'm trying to do more:

1) Is there a way to dynamically create and configure a new queue in Java "on the fly"?

2) Also, once I have a queue (either through queue.xml or 1) if possible), is there a way to pause and resume the queue in Java (just like you can do using the admin console buttons)?

Thanks!

解决方案

1) since it has to be in the queue.xml and uploaded with your app, I can't think of a way to do it. As mentioned here: "An app can only add tasks to queues defined in queue.xml and the default queue."

2) in the same page, just a bit further down, you can see that if you set the processing rate of 0, it will pause your queue. To resume, just change it back to something else. Unfortunately that is all done through the xml, not through your code directly.

You might want to take this to Google's Public Issue Tracker as a Feature Request.

这篇关于如何以编程方式创建&暂停Google App Engine任务队列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-28 07:04