Reputation: 2630
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 queue it is simple taskqueue.add(...)
how do we do it for a custom queue?
Upvotes: 4
Views: 1174
Reputation: 4802
this works for me:
final Queue queue = QueueFactory.getQueue("queuename);
queue.add(TaskOptions.Builder.withUrl("/path/to/queue"); //as defined in web.xml
Upvotes: 0
Reputation: 16233
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')
Upvotes: 10