code: def background_reader(stream, loop: asyncio.AbstractEventLoop, callback):
      
  
      for line in iter(stream.readline, b''):
          loop.call_soon_threadsafe(loop.create_task, callback(line))
docs: Reads a stream and forwards each line to an async callback.