MCPcopy Index your code
hub / github.com/Effect-TS/effect / onDefect

Function onDefect

packages/cluster/src/internal/entityManager.ts:300–316  ·  view source on GitHub ↗
(cause: Cause.Cause<never>)

Source from the content-addressed store, hash-verified

298 )
299
300 function onDefect(cause: Cause.Cause<never>): Effect.Effect<void> {
301 if (!activeServers.has(address.entityId)) {
302 return endLatch.open
303 }
304 const effect = writeRef.unsafeRebuild()
305 defectRequestIds = Array.from(activeRequests.keys())
306 return Effect.logError("Defect in entity, restarting", cause).pipe(
307 Effect.andThen(Effect.ignore(retryDriver.next(void 0))),
308 Effect.flatMap(() => activeServers.has(address.entityId) ? effect : endLatch.open),
309 Effect.annotateLogs({
310 module: "EntityManager",
311 address,
312 runner: options.runnerAddress
313 }),
314 Effect.catchAllCause(onDefect)
315 )
316 }
317
318 const state: EntityState = {
319 scope,

Callers 1

onFromServerFunction · 0.85

Calls 4

unsafeRebuildMethod · 0.80
keysMethod · 0.80
pipeMethod · 0.65
nextMethod · 0.65

Tested by

no test coverage detected