title: How to add a task to event loop while it is already running in asyncio library in python3.7?
body: <pre><code># !/usr/bin/python3
  
  import asyncio
  import aiohttp
  from threading import Thread
  
  
  event_loop = asyncio.get_event_loop() # getting the event_loop
  Thread(target=event_loop.run_forever).start() # creating one more thread(to add and then to execute tasks when it is necessary)
  
  
  async def fetch(session, url): # exm/doc code from aiohttp lib.
      async with session.get(url) as response:
          return await response.text()
  
  
  async def main(): # exm/doc code from aiohttp lib.
      async with aiohttp.ClientSession() as session:
          html = await fetch(session, 'http://python.org')
          print(html)
  
  
  event_loop.create_task(main()) # doesn't work when the event_loop is already running... Is it the only way to add task before running the event_loop in asyncio?
  
  </code></pre>
  <p>The goal is to add task when it is necessary. For example, the main thread is for listening to a  server and the second one is for responding. P.s this is only a small part of all code/</p>
  <p>Am I doing something wrong or the asyncio library does not support this?</p>