title: Scheduling an asyncio coroutine from another thread
body: <p>I try to schedule an asyncio coroutine from another thread using <code>create_task()</code>. The problem is that the coroutine is not called, at least not in reasonable amount of time.</p>
  
  <p>Is there are way to wake up the event loop or at least specify a shorter timeout?</p>
  
  <pre><code>#!/usr/bin/python3
  
  import asyncio, threading
  
  event_loop = None
  
  @asyncio.coroutine
  def coroutine():
      print("coroutine called")
  
  def scheduler():
      print("scheduling...")
      event_loop.create_task(coroutine())
      threading.Timer(2, scheduler).start()
  
  def main():
      global event_loop
  
      threading.Timer(2, scheduler).start()
  
      event_loop = asyncio.new_event_loop()
      asyncio.set_event_loop(event_loop)
      event_loop.run_forever()
  
  main()
  </code></pre>
  
  <p>Output:</p>
  
  <pre><code>scheduling...
  scheduling...
  scheduling...
  scheduling...
  </code></pre>