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

Function makeShardId

packages/cluster/src/Entity.ts:509–513  ·  view source on GitHub ↗
(entityId: string)

Source from the content-addressed store, hash-verified

507) {
508 const config = yield* ShardingConfig
509 const makeShardId = (entityId: string) =>
510 ShardId.make(
511 entity.getShardGroup(entityId as EntityId),
512 (Math.abs(hashString(entityId) % config.shardsPerGroup)) + 1
513 )
514 const snowflakeGen = yield* Snowflake.makeGenerator
515 const runnerAddress = new RunnerAddress({ host: "localhost", port: 3000 })
516 const entityMap = new Map<string, {

Callers 3

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

Calls 3

hashStringFunction · 0.85
getShardGroupMethod · 0.80
makeMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…