Hacker News new | past | comments | ask | show | jobs | submit login

Great article! One minor nit: When explaining the bag vs duplicate_bag thing, it says

> The difference between bag and duplicate_bag is that duplicate_bag will allow multiple entries for the same key.

bag also allows multiple entries per key. After reading the ETS documentation, it appears that duplicate_bag allows the same object instance to appear as a value for a key multiple times, whereas bag only allows an object instance to be added once to a key (e.g. so if you add the exact same object instance to the table using a given key, bag will only end up with one value for the key, but duplicate_bag will happily have many identical values for that key).

The following sentence is still fine:

> Since each socket can only connect once and have one pid, using a duplicate bag didn't cause any issues for us.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: