Sonyflake.Setting.new
You're seeing just the function
new
, go back to Sonyflake.Setting module for more information.
Link to this function
new()
Specs
new() :: %Sonyflake.Setting{ machine_id: non_neg_integer(), start_time: non_neg_integer() }
Generate configuration for initialising a new Sonyflake generator instance.
Link to this function
new(start_time)
Specs
new(DateTime.t()) :: nil | %Sonyflake.Setting{ machine_id: non_neg_integer(), start_time: non_neg_integer() }
Generate configuration for initialising a new Sonyflake generator instance.
The start_time
is used as initial seed for sequence.
Link to this function
new(start_time, machine_id, check_machine_id)
Specs
new(DateTime.t(), (() -> non_neg_integer()), (non_neg_integer() -> boolean())) :: nil | %Sonyflake.Setting{ machine_id: non_neg_integer(), start_time: non_neg_integer() }
Generate configuration for initialising a new Sonyflake generator instance.
The start_time
is used as initial seed for sequence. machine_id
is used to generate a non_neg_integer
identifier for machine,
which is then further validated with the check_machine_id
call.