Miniature-Distributed-System / Worker-Unit

Worker/Compute Unit which communicates with the Server Unit in receiving/processing/sending back results to server.
GNU General Public License v3.0
1 stars 0 forks source link

Fix: Socket: Missed packets and performance issue #11

Closed trax85 closed 9 months ago

trax85 commented 9 months ago

The packets are popped by the socket task which pops in each iteration. this causes problems if both worker connections are busy the popped packet would get dropped and the message would never get through to the server. This also causes performance issues as we are calling sender unit in every iteration which is not required. rather only call it in websocket launch task when the connection is aquired by the socket task. once connection is aquired we can pop the packet and pass it to the websocket.

Therefore all the socket now does is check for connection status and launch websocket if connections are available. The launched connection pops the packet from sender unit.