effect-io-ai

Package: effect
Module: Scheduler

Scheduler.MaxOpsBeforeYield

Context reference that controls the maximum number of operations a fiber can perform before yielding control back to the scheduler.

When to use

Use to tune scheduler fairness for CPU-bound fibers by changing the scheduler operation budget that triggers a yield.

Details

The default value is 2048 operations, which balances performance and fairness by helping prevent long-running fibers from monopolizing the execution thread.

See

Signature

declare const MaxOpsBeforeYield: Context.Reference<number>

Source

Since v4.0.0