title: Run coroutine loop in different thread
body: <p>I want to call <code>streamSimulation</code> four times split among 2 threads.</p>
  
  <p>How can I create a second loop, create a second thread and execute the loop in that thread?</p>
  
  <pre><code>import asyncio
  import functools
  from concurrent.futures import ThreadPoolExecutor
  
  
  async def streamSimulation(p1,p2,p3,p4):
      print("Stream init")
      while True:
          await asyncio.sleep(2)
          print("Stream Simulation")
          print("Params: " + p1 + p2 + p3 + p4)
          doSomething()
  
  def doSomething():
      print("Did something")
  
  def main():
      loop = asyncio.get_event_loop()
      #Supposed to run in first thread
      asyncio.ensure_future(streamSimulation("P1","P2","P3","P4"))
      asyncio.ensure_future(streamSimulation("A1","A2","A3","A4"))
      #Supposed to run in second thread
      asyncio.ensure_future(streamSimulation("Q1","Q2","Q3","Q4"))
      asyncio.ensure_future(streamSimulation("B1","B2","B3","B4"))
      loop.run_forever()
  
  main()
  </code></pre>