4 ms·
ETS has no facility to insert/remove an object and get the index at which the object was inserted to/removed from. This is needed in order to synchronize window
by jhgg 7y ago
ETS has no facility to insert/remove an object and get the index at which the object was inserted to/removed from. This is needed in order to synchronize windows within the sorted set to our clients. We would have loved to use ETS, and use it in many places actually, and have open-sourced a few:
- https://github.com/discordapp/zen_monitor https://github.com/discordapp/zen_monitor
- https://github.com/discordapp/gen_registry https://github.com/discordapp/gen_registry
- https://github.com/discordapp/ex_hash_ring https://github.com/discordapp/ex_hash_ring
- toast0 7y agoI don't know if it would be good enough,and there's certainly not a big reason for you to try, given your solution works great; but you could probably modify ets to give you the slot number where it inserted/removed and use that as a non-exact indicator of where in the sequence it was. (Depending on how accurate you need it to be, this might work?)