demos
demos

Reputation: 2630

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 queue it is simple taskqueue.add(...)

how do we do it for a custom queue?

Upvotes: 4

Views: 1174

Answers (2)

bsautner
bsautner

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

David Underhill
David Underhill

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

Related Questions