Closed abetusk closed 10 years ago
This will brutalize any mobile data plan under the current framework, so I'm turning this into a bug.
So it would probably be a good idea on the server side to keep a copy of the data from last poll and then modify that data and have a property on each entry like
status: update status: delete (Guessing this would be where the entry is in the old and not the new). status: add
That can be then used on the client side to update its configuration of the markers. Probably would be a good idea to update the markers already existing or destroy them if they are marked as such. This will probably be easier on the client side as well.
The server should be able to figure out which entry needs updating, removal or creation. Whenever a client connects, the whole snapshot is sent. Whenever the server detects a single change, it can immediately can push to all connected clients, be it an update, removal or creation.
The client needs to make sure it can process single changes.
Not necessary, but a 'nice to have' feature would be to periodically send some sanity check data, like a checksum or other digested information, to make sure the client and server are in sync. If they aren't a whole snapshot is sent. This way the new system should be no worse than the old one.
Another nice to have feature would be to detect when the number of deltas exceeds a threshold in a short amount of time and just send the snapshot instead. This is probably unnecessary right now, but something to consider for later.
As it stands, the server retransmits the entire positions of the marker locations to each of the clients. This can be slimmed down to only transmit additions, deletions and updates of elements when they happen. I can imagine this might be a bit brutal for mobile devices.