with-timestamp
, which can be used to contain flake
generation to a bounded time window. While unlikely, generate!
could
repeatedly lose the race to generate a flake which could be undesirable--
wrapping generate!
with with-timeout
addresses this issue.read-string
with Integer/parseInt in reading timestamps
from disk. This is generally safer, as read-string
is essentially
eval
.System/currentTimeMillis
with a custom epoch derived from
the difference between System/currentTimeMillis
and System/nanonTime
.
In order to protect against clock skew, a sampling of deltas between the
two is taken and the average is used as the epoch for yielding new
timestamps.write-timestamp
was changed to
include the epoch as the final argument.generate!
simultaneously, the fact that the timestamp comparison was done outside of
the swap update function could result in duplicate IDs.null
devices and picking the first seemingly valid hardware address.generate
is now generate!
in addition, other functions removed.generate!
now returns a ByteBuffer--use flake->bigint
to
maintain backwards compatibility.flake.timer
.SecureRandom
when
no hardware interfaces can be found.clojure.test/is
macro.write-timestamp
was reversed, resulting in an exception.Can you improve this documentation?Edit on GitHub
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close