开发者

Custom Task Queue in App Engine?

I have created a new task queue and defined it in queue.yaml

I am not sure how to start adding tasks to this queue?

with the default que开发者_开发知识库ue it is simple taskqueue.add(...)

how do we do it for a custom queue?


You may specify which queue to add a task to by passing a queue_name parameter (documentation). queue_name defaults to "default". Example:

 taskqueue.Task(url='...', params={...}).add(queue_name='my_custom_queue')


this works for me:

final Queue queue = QueueFactory.getQueue("queuename);
queue.add(TaskOptions.Builder.withUrl("/path/to/queue"); //as defined in web.xml 
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜