title: How to run async process from handler in aiohttp
body: <p>I'm trying to understand how to run an asynchronous process from coroutine handler within aioweb framework. Here is an example of code:</p>
  
  <pre><code>def process(request):
      # this function can do some calc based on given request
      # e.g. fetch/process some data and store it in DB
      # but http handler don't need to wait for its completion
  
  async def handle(request):
      # process request
      process(request) ### THIS SHOULD RUN ASYNCHRONOUSLY
  
      # create response
      response_data = {'status': 'ok'}
  
      # Build JSON response
      body = json.dumps(response_data).encode('utf-8')
      return web.Response(body=body, content_type="application/json")
  
  def main():
      loop = asyncio.get_event_loop()
      app = web.Application(loop=loop)
      app.router.add_route('GET', '/', handle)
  
      server = loop.create_server(app.make_handler(), '127.0.0.1', 8000)
      print("Server started at http://127.0.0.1:8000")
      loop.run_until_complete(server)
      try:
         loop.run_forever()
      except KeyboardInterrupt:
         pass
  
  if __name__ == '__main__':
     main()
  </code></pre>
  
  <p>I want to run <code>process</code> function asynchronously from the handler. Can someone provide an example how I can achieve that. I'm struggle to understand how I can pass/use main event loop within a handler and pass it around to another function which by itself can run async process within it.</p>