title: RuntimeError: There is no current event loop in thread 'Thread-1' , multithreading and asyncio error
body: <p>I am having a thread which calls asyncio loops, however this causes the mentioned exception:</p>
  
  <pre><code>RuntimeError: There is no current event loop in thread 'Thread-1'.
  </code></pre>
  
  <p>This question: <a href="https://stackoverflow.com/questions/46727787/runtimeerror-there-is-no-current-event-loop-in-thread-in-async-apscheduler">RuntimeError: There is no current event loop in thread in async + apscheduler</a> came across the same problem, however they refered to a scheduler which I do not have. </p>
  
  <p>My code is the following:</p>
  
  <pre><code>def worker(ws):
        l1 = asyncio.get_event_loop()
        l1.run_until_complete(ws.start())  
  
  
        l2 = asyncio.get_event_loop()
        l2.run_forever()
  
  
  if __name__ == '__main__':
      ws = Server()
      p = threading.Thread(target=worker,args=(ws,))
      p.start()
  
  
      while True:
          try:
              #...do sth
          except KeyboardInterrupt:
              p.join()
              exit() 
  </code></pre>