Say you have a process that is connected to two or more different IRC servers running on the same network, and you want to aggrigate events on both servers into a single stream.
Due to latency within the network, events may arrive from both servers in different order and at different times. The events look identical in how they arrive, and may be identical to simmilar events occuring at another time (eg, a user joins, parts and re-joins, producing two identical join events).
How do you reconcile the streams?
I'm thinking that perhaps I could hash the contents of the event and store it with a list of all connections that have seen that hash. When an event occurs, look for the most recent matching hash that server hasn't mapped to. Then if the same hash occurs twice, each connection reconciles the events in the order they receive them.
I'm just not sure how to handle if one of the connections doesn't receive one of the events (eg, during a netsplit).