-
Notifications
You must be signed in to change notification settings - Fork 10
Open
Description
Description
This change should add a constructor to the Snowflake type intended for use by servers, or more accurately, producers of new Snowflake values.
API Proposal
public Snowflake(DateTimeOffset timeStamp, byte internalWorkerId, byte internalProcessId, ushort increment, ulong epoch = 0);
public Snowflake(DateTimeOffset timeStamp, byte internalWorkerId, byte internalProcessId, ushort increment, DateTimeOffset? epoch = null);These methods likely would not be able to forward to the existing Snowflake(ulong, ulong) ctor due to the need for a method body to perform multiple mathematical operations.
Why This is Needed
Currently, the Snowflake type is intended for use solely by consumers, e.g. those who are sent Snowflake values over an API or who store them in a database. This is not suitable for producers of this type, who would currently need to produce the Snowflake value themselves as a ulong, then pass that to the Snowflake(ulong, ulong) ctor.
Metadata
Metadata
Assignees
Labels
No labels