0

Google's doc on async tasks assumes knowledge of the difference between regular and asynchronously added tasks.

add_async(task, transactional=False, rpc=None)
Asynchronously add a Task or a list of Tasks to this Queue.

How is adding tasks asynchronously different to adding them regularly.

I.e. what is the difference between using add(task, transactional=False) and add_async(task, transactional=False, rpc=None)

I've heard that adding tasks regularly blocks certain things. Any explanation of what it blocks and how, and how async tasks don't block would be greatly appreciated.

Ben
  • 5,085
  • 9
  • 39
  • 58
  • 1
    It is same as other async operation on GAE, it does not wait until the operation finish. – marcadian May 28 '14 at 22:11
  • Does the code hang until the tasks finishes? Do child tasks not execute until it finishes? Etc. – Ben May 28 '14 at 22:23

1 Answers1

2

tasks are scheduled and run elsewhere.

The async bit refers to the fact the call returns immediately (your code does not wait for the round trip of the RPC that submits the task to a queue) however you still have to check/wait for the result at the end of the request, but it means you can be doing work and then check that the call completed before you exit.

Tim Hoffman
  • 12,976
  • 1
  • 17
  • 29