MCPcopy Create free account
hub / github.com/Effect-TS/effect / makeShardId

Function makeShardId

packages/effect/src/unstable/cluster/Entity.ts:614–618  ·  view source on GitHub ↗
(entityId: string)

Source from the content-addressed store, hash-verified

612) {
613 const config = yield* ShardingConfig
614 const makeShardId = (entityId: string) =>
615 ShardId.make(
616 entity.getShardGroup(entityId as EntityId),
617 (Math.abs(hashString(entityId) % config.shardsPerGroup)) + 1
618 )
619 const snowflakeGen = yield* Snowflake.makeGenerator
620 const runnerAddress = new RunnerAddress({ host: "localhost", port: 3000 })
621 const entityMap = new Map<string, {

Callers 3

Entity.tsFile · 0.85
getShardIdFunction · 0.85
Sharding.tsFile · 0.85

Calls 3

hashStringFunction · 0.90
getShardGroupMethod · 0.80
makeMethod · 0.65

Tested by

no test coverage detected