effect-io-ai

Package: effect
Module: Effect

Effect.yieldNowWith

Yields control back to the Effect runtime with a specified priority, allowing other fibers to execute.

Example (Yielding with priority)

import { Effect } from "effect"

const program = Effect.gen(function*() {
  console.log("High priority task")
  yield* Effect.yieldNowWith(10) // Higher priority
  console.log("Continued after yield")
})

Effect.runPromise(program)

Signature

declare const yieldNowWith: (priority?: number) => Effect<void>

Source

Since v4.0.0