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

Function makeTerminationSharding

packages/cluster/test/Sharding.test.ts:1601–1620  ·  view source on GitHub ↗
(state: FailoverStorageState)

Source from the content-addressed store, hash-verified

1599]).annotateRpcs(ClusterSchema.InterruptOnTermination, true)
1600
1601const makeTerminationSharding = (state: FailoverStorageState) =>
1602 Sharding.layer.pipe(
1603 Layer.provide(Layer.effect(
1604 RunnerStorage.RunnerStorage,
1605 Effect.map(Effect.clock, (clock) => makeFailoverStorage(state, clock))
1606 )),
1607 Layer.provide([RunnerHealth.layerNoop, Runners.layerNoop]),
1608 Layer.provide([MessageStorage.layerMemory, Snowflake.layerGenerator]),
1609 Layer.provide(ShardingConfig.layer({
1610 runnerAddress: Option.some(RunnerAddress.make("localhost", 1234)),
1611 shardsPerGroup: 1,
1612 shardLockExpiration: 3000,
1613 shardLockRefreshInterval: 100,
1614 entityTerminationTimeout: 1000,
1615 entityMessagePollInterval: 10,
1616 entityReplyPollInterval: 10,
1617 refreshAssignmentsInterval: 10,
1618 sendRetryInterval: 10
1619 }))
1620 )
1621
1622interface FailoverStorageState {
1623 blackholed: boolean

Callers 1

Sharding.test.tsFile · 0.85

Calls 5

makeFailoverStorageFunction · 0.85
pipeMethod · 0.65
provideMethod · 0.65
mapMethod · 0.65
makeMethod · 0.65

Tested by

no test coverage detected