Hyperlinkv0.8.0-beta.28

Scheduler

Scheduler.PreventSchedulerYieldconsteffect/Scheduler.ts:283
Context.Reference<boolean>

Context reference that controls whether the runtime should bypass scheduler yield checks. When set to true, the fiber run loop won't call Scheduler.shouldYield.

When to use

Use to bypass scheduler yield checks for controlled runtime workloads where cooperative yielding should be disabled.

Gotchas

Setting this reference to true can let long-running fibers monopolize the JavaScript thread.

export const PreventSchedulerYield = Context.Reference<boolean>("effect/Scheduler/PreventSchedulerYield", {
  defaultValue: () => false
})
Referenced by 1 symbols