I'm listening serial port using pySerial
. Data processed only when I got chunk of data, that I can process. Simple event dispatcher listen for events from readet, then event data handled. Handling may involve IO, Networking and another type of time-consuming OS operations. But who will read data from serial in time of processing last data?
For example
Port stream >> | 1111111111111111 | 222222 | 2222222 | 33333
---------------------------------------------
Programm thread >> | listen port 1 -> | handle | listen2 | .....
So data from port which come in time on handling will be lost? like starting of package of 2
?
How to to guarantee, that all data from port will be processed in time?
- Hardware: Raspberry PI 3b
- OS: Raspbian
- Python: v2.7