Hyperlinkv0.8.0-beta.28

Effect

Effect.yieldNowWithconsteffect/Effect.ts:1730
(priority?: number): Effect<void>

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)
constructors
Source effect/Effect.ts:17301 lines
export const yieldNowWith: (priority?: number) => Effect<void> = internal.yieldNowWith