14.07.2015, 08:26
Our example can be tuned for more messages per second if needed, but it will increase CPU load slightly.
It's true that UDP packets can be lost over a network. In our example UDP communication happens locally over a virtual loopback interface, so it should be fine.
You example has a race conditions between storage.get and storage.set calls which can lead to some messages being lost.
Anyway, if you really need to process a large amount of data you should use some ready-made solutions like MQTT.
It's true that UDP packets can be lost over a network. In our example UDP communication happens locally over a virtual loopback interface, so it should be fine.
You example has a race conditions between storage.get and storage.set calls which can lead to some messages being lost.
Anyway, if you really need to process a large amount of data you should use some ready-made solutions like MQTT.