3 ms·
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 https://crates.io/crates
by jhgg 6y ago
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 https://crates.io/crates/flake
- Dowwie 6y agosorry, missed the N at the end -- I refer to "flaken": https://crates.io/crates/flaken https://crates.io/crates/flaken snowflake libraries generally aren't updated after they're stabilized
- jhgg 6y agoNo 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.