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

Function getShardId

packages/cluster/src/Sharding.ts:234–237  ·  view source on GitHub ↗
(entityId: EntityId, group: string)

Source from the content-addressed store, hash-verified

232 Option.isSome(config.runnerAddress) && Equal.equals(address, config.runnerAddress.value)
233
234 function getShardId(entityId: EntityId, group: string): ShardId {
235 const id = Math.abs(hashString(entityId) % config.shardsPerGroup) + 1
236 return makeShardId(group, id)
237 }
238
239 function isEntityOnLocalShards(address: EntityAddress): boolean {
240 return MutableHashSet.has(acquiredShards, address.shardId)

Callers 1

Sharding.tsFile · 0.70

Calls 2

hashStringFunction · 0.85
makeShardIdFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…