classy_uid ¶This module contains utilities for constructing unique IDs using various algorithms.
-spec
cluster_unique_seq_tuple(sequence()) -> cu_tuple().
Similar to classy_uid:site_unique_seq_tuple/1, but includes site name.
-spec site_unique_seq_tuple(sequence()) -> su_tuple().
Return a tuple that is guaranteed to be unique within sequence ID and site.
It consists of number of restarts followed by a value of a volatile counter identified by sequence ID. Sequence counter gets reset on node restart.
This function is expected to be slower than classy_uid:site_unique_tuple/0,
but its values form a monotonic sequence.
-spec cluster_unique_tuple() -> cu_tuple().
Return a tuple similar to classy_uid:site_unique_tuple/0, but also including site id, which makes it unique within the cluster.
Cluster-unique tuples can be used to order events on the originator site, but not globally.
-spec site_unique_tuple() -> su_tuple().
Return a tuple that is unique within the site (across restarts), but is NOT unique in a cluster.
SeqTuple returned by this function consists of a number of node
restarts followed by a erlang:unique_integer.
Site-unique tuples can be used to order events within the site.