Dulini Atapattu
Dulini Atapattu

Reputation: 2735

Consuming tasks from GAE Task Queue

I would like to use Task Queue with my App in GAE. As I know (according to Task Queue documentation and API), we can add tasks to push queue, and then they are being consumed automatically by the app. Also in pull queue, we can add tasks, and tasks are being consumed automatically according to scaling properties we handle.

I would like to know whether there is ability to consume tasks from task queue (push or pull queues), when we want by calling a consume-like method?

Thanks

Upvotes: 1

Views: 278

Answers (2)

Sebastian Kreft
Sebastian Kreft

Reputation: 8189

Note that the tasks added to a pull queue are not automatically consumed.

The consume-like method you want is lease_tasks (note this is for pull queues only). If you want to consume the tasks at a given time you can have an endpoint that processes these tasks. Also you can set cron jobs to call that particular endpoint.

Upvotes: 1

Shay Erlichmen
Shay Erlichmen

Reputation: 31928

I think you misunderstood how push and pull task queues works. In both queues you add tasks to the queue, but while in push queue the system will dequeue the task and assign it to the apropriate handler in pull queue you need to dequeue the task(s) using lease_tasks and handle the task.

Upvotes: 3

Related Questions