+--------------+ +---------------+
| IO | | Target (main) |
+--------------+ +---------------+
enque(msg) -----> on('msg') // while running
msg = poll() // while paused
dispatch(msg) <-- enque(msg)
- Never parse messages in IO thread
- Transfer line-by-line to main thread
- Have smart logic that manages the queue polling