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

Function checkHandedOff

packages/cluster/src/Sharding.ts:369–378  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

367 })
368 // Called from the acquisition loop only, so no acquire is in flight
369 const checkHandedOff = () => {
370 if (
371 handingOff &&
372 MutableHashSet.size(acquiredShards) === 0 &&
373 MutableHashSet.size(releasingShards) === 0 &&
374 !forcedShardReleasePending()
375 ) {
376 handedOff.unsafeOpen()
377 }
378 }
379 // While handing off, the pending shards are released together: one
380 // teardown pass for all of them, then each lock is released.
381 let handoffReleaseRunning = false

Callers 1

Sharding.tsFile · 0.85

Calls 3

unsafeOpenMethod · 0.80
sizeMethod · 0.65

Tested by

no test coverage detected