IdWorker

class IdWorker[F[_]](state: Ref[F, WorkerState], epoch: Long, dataCenterId: Long, workerId: Long)(`evidence$1`: Sync[F], `evidence$2`: Logger[F])

Generates new snowflake ids. Use IdWorkerBuilder to create workers.

Generates new snowflake ids. Use IdWorkerBuilder to create workers.

Companion
object
class Object
trait Matchable
class Any

Value members

Concrete methods

def getTimeStamp(snowflake: Snowflake): Long

Extracts the timestamp of a snowflake.

Extracts the timestamp of a snowflake.

Value Params
snowflake

The snowflake to extract from.

Returns

The timestamp of the snowflake.

def nextIdPure(timeStamp: Long, sequence: Long): Snowflake

Constructs a new Snowflake from the given timestamp and sequence.

Constructs a new Snowflake from the given timestamp and sequence.

Value Params
sequence

The sequence of the snowflake.

timeStamp

The timestamp of the snowflake.

Concrete fields

val nextId: F[Snowflake]

Generates a new snowflake id.

Generates a new snowflake id.

Returns

A new snowflake id.