Question on LeaseOptions

24 views
Skip to first unread message

tonycavanagh1929

unread,
May 19, 2019, 3:12:03 PM5/19/19
to Google App Engine
I am looking at tasks, I am trying to understand what is the purpose of LeaseOptions

In the docs it says so

Once tasks are in a pull queue, a worker can lease them. After the tasks are processed the worker must delete them.

So does lease just mean get a task of a queue and then run that task

George (Cloud Platform Support)

unread,
May 19, 2019, 4:14:50 PM5/19/19
to Google App Engine
Hello Tony, 

You are right, the shortest formulation for lease in this context is the one you wrote: get a task and then run it. There are still some other important elements to this: leasing a task makes it unavailable for processing by another worker, and it remains unavailable until the lease expires. This is an important aspect: no other worker has access to the task that was leased, not until this lease expires. It follows, as expected, that once a worker completes a task, it needs to delete the task from the queue. 

tonycavanagh1929

unread,
May 20, 2019, 3:01:45 AM5/20/19
to Google App Engine
Thank you, I just wanted to check that my undestanding was correct.

Cheers Tony
Reply all
Reply to author
Forward
0 new messages