I am trying to rewrite the java version of Coalescing ring buffer in Rust. Original implementation can be found at https://github.com/LMAX-Exchange/LMAXCollections
My version in rust which does not work yet can be found at https://github.com/mmrath/rbuf
The idea is that a producer and a consumer thread will have a shared instance of this collection. The producer will continuously push(offer) objects on to collection and consumer will poll from the collection. Latest objects with same key will overwrite any unconsumed objects with the same key.
I am not able to decide what kind of data structure to use for the values. Any help is appreciated.