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

Method suspendedWarningStart

packages/effect/src/TestClock.ts:355–375  ·  view source on GitHub ↗

* Forks a fiber that will display a warning message if a test is advancing * the `TestClock` but a fiber is not suspending.

()

Source from the content-addressed store, hash-verified

353 * the `TestClock` but a fiber is not suspending.
354 */
355 suspendedWarningStart(): Effect.Effect<void> {
356 return synchronized.updateSomeEffect(this.suspendedWarningState, (suspendedWarningData) => {
357 if (SuspendedWarningData.isStart(suspendedWarningData)) {
358 return Option.some(
359 pipe(
360 this.live.provide(
361 pipe(
362 effect.logWarning(suspendedWarning),
363 core.zipRight(ref.set(this.suspendedWarningState, SuspendedWarningData.done)),
364 effect.delay(Duration.seconds(5))
365 )
366 ),
367 core.interruptible,
368 fiberRuntime.fork,
369 core.map((fiber) => SuspendedWarningData.pending(fiber))
370 )
371 )
372 }
373 return Option.none()
374 })
375 }
376 /**
377 * Cancels the warning message that is displayed if a test is advancing the
378 * `TestClock` but a fiber is not suspending.

Callers 1

awaitSuspendedMethod · 0.95

Calls 4

pipeFunction · 0.70
provideMethod · 0.65
setMethod · 0.65
mapMethod · 0.65

Tested by

no test coverage detected