An application (Saver) receives live data over a websocket from a remote server and stores it in a database. It exposes a REST endpoint to clients that returns all data stored in the database so far.
A client application subscribes to live data on the remote server's websocket on start up. It then makes the request to Saver's REST endpoint, and receives all data so far.
Both data sources are exposed as IObservable<AType>
in the client application.
AType
includes a Timestamp property.
How can I combine these two Observables so that they are sequential (by timestamp) without duplicates?
Update: duplicates are not possible within either one of the data sources/Observables, but are possible when they are combined, since the websocket is subscribed to before the REST endpoint is called. They are subscribed to in that order to avoid loss of data.