title: Python: how to host a websocket and interact with a serial port without blocking?
body: <p>I am busy developing a Python system that uses web-sockets to send/received data from a serial port.</p>
  
  <p>For this to work I need to react to data from the serial port as it is received. Problem is to detect incoming data the serial port needs to queried continuously looking for incoming data. Most likely a continuous loop. From previous experiences(Slow disk access + heavy traffic) using Flask this sounds like it could cause the web-sockets to be blocked. Will this be the case or is there a work around?</p>
  
  <p>I have looked at how NodeJS interact with serial ports and it seems much nicer. It raises an event when there is incoming data instead of querying it all the time. Is this an option in Python?</p>
  
  <p><strong>Extra Details:</strong> </p>
  
  <ul>
  <li>For now it will only be run on Linux.(Raspbian)</li>
  <li>Flask was my first selection but I am open to other Python Frameworks.</li>
  <li>pyserial for serial connection.(Is the only option I know of)</li>
  </ul>