Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The one that says "wip; use at your own risk" with no updates in the last 5 years? Or is there another?

https://crates.io/crates/flake



sorry, missed the N at the end -- I refer to "flaken": https://crates.io/crates/flaken

snowflake libraries generally aren't updated after they're stabilized


No I didn't but after looking at it it looks like its implementation falls short.

- it only looks at system time at system startup, then relies on instant for monotonic clock source. unfortunately for setups that do leap-second smearing (ours does), this would deviate slightly out of sync after operating for a while.

- does not handle seq overflow within a given millisecond window - this i think is very unsafe, and can cause the generation of duplicate IDs if `next_id` is called at too rapid an interval.




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

Search: