I'm building a server-to-many-listeners application where the server has a "master list" that changes many times per second, and these updates need to be streamed to connected clients, so that they can keep a state identical to the server's.
The list contains pricing data, representing an orderbook from an asset exchange and looks like this:
[[1.0, 0.002], [1.1, 1.2039], [1.2, 0.29183]]
...where the first value is the price, and the second is the amount.
The idea would be that the client would receive the full list upon first connecting (or by some other side-channel), and would then incrementally apply the changes as they stream in.
Is there a pattern for doing this sort of thing? Efficiency is important here (but 2nd to correctness), so preferably the amount of data transferred is kept to a minimum.
Aucun commentaire:
Enregistrer un commentaire