title: How to use Python asyncio on Google Cloud Functions?
body: <p>I have a google cloud function triggered by HTTP request does following two tasks:</p>
  <pre><code>def task1():
    do sth
    return info
  
  def task2(info):
    do sth
    
  def main(request)
    info=task1()
    if (info):
      task2(info)
    return info
  </code></pre>
  <p>I would like the function returns without waiting the task2 completes. So I did following changes:</p>
  <pre><code>import asyncio
  
  def task1():
    do sth
    return info
  
  async def task2(info):
    do sth
  
  async def bar(info):
    return await task2(info)
    
  def main(request)
    info=task1()
    if (info):
      asyncio.run(bar(info))
    return info
  </code></pre>
  <p>Not sure if I did is correct? But I didn't notice the function gets any faster. Can anyone give me some suggestions?</p>