Skip to content

Extend StaticShardedDO to allow the jump consistent hashing method #12

@lambrospetrou

Description

@lambrospetrou

In addition to the existing hashing method for StaticShardedDO add the jump consistent hash function introduced for the dynamic autoscaled DO:

function consistentHash(key: number, numBuckets: number): number {

Extend the options in https://github.com/lambrospetrou/durable-utils/blob/main/src/do-sharding.ts#L16 to accept the hash function as option, and use the existing xxHash as default to avoid breakage, and only change the default in v1.0.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions