exnowflake v0.1.0 Exnowflake.Worker View Source
This worker generates unique time based IDs.
Link to this section Summary
Functions
Returns a specification to start this module under a supervisor.
Generates a 64 bit integer based on time, worker ID and a sequence.
Returns milliseconds passed since epoch when ID was generated.
Returns the real timestamp of an ID in milliseconds.
Link to this section Functions
Returns a specification to start this module under a supervisor.
See Supervisor
.
Link to this function
generate()
View Sourcegenerate() :: {:ok, integer()} | {:error, :backwards_clock}
Generates a 64 bit integer based on time, worker ID and a sequence.
Returns milliseconds passed since epoch when ID was generated.
Returns the real timestamp of an ID in milliseconds.