View Source UniqueID (unique_id v1.1.0)
A fast 64 bit unique id generator
Summary
Functions
Returns a specification to start this module under a supervisor.
next_id operation guarantee atomicity
Types
@type machine_id_value() :: non_neg_integer()
@type ref() :: :atomics.atomics_ref()
@type seq_value() :: non_neg_integer()
@type timestamp_value() :: non_neg_integer()
@type uid_value() :: non_neg_integer()
Functions
Returns a specification to start this module under a supervisor.
See Supervisor
.
@spec extract_id(ref() | String.t() | nil, uid_value()) :: {machine_id_value(), timestamp_value(), seq_value()}
@spec new(machine_id_value(), non_neg_integer(), non_neg_integer()) :: {:ok, ref()} | :error_overflow_machine_id | :error_exceed_machine_id_bits
Link to this function
new_with_name(name, machine_id, timestamp_bits \\ 42, seq_bits \\ 12)
View Source@spec new_with_name( String.t(), machine_id_value(), non_neg_integer(), non_neg_integer() ) :: {:ok, ref()} | :error_exceed_machine_id_bits | :error_overflow_machine_id
next_id operation guarantee atomicity