Module Await_in_async

val schedule_with_await : ?monitor:Async.Monitor.t -> ?priority:Async.Priority.t -> Await_kernel.Terminator.t -> f:(Await_kernel.Await.t @ local -> 'a) @ once -> 'a Async.Deferred.t

schedule_with_await terminator ~f schedules f w as a fiber to run on the async scheduler with a w : Await.t that will resume execution of the fiber after a blocking await on the async scheduler.

val await_deferred : Await_kernel.Await.t @ local -> ('a Async.Deferred.t -> 'a) @ local

await_deferred w deferred awaits until the deferred becomes determined.

  • raises [Terminated]

    if w is terminated before deferred becomes determined.

val non_eager_await_deferred : Await_kernel.Await.t @ local -> ('a Async.Deferred.t -> 'a) @ local

non_eager_await_deferred w deferred awaits until the deferred becomes determined. Unlike await_deferred, non_eager_await_deferred always resumes the current fiber in a new async job, even if deferred is already determined. This is considerably slower than immediately calling Deferred.value_exn, but closer to semantics-preserving with regard to Deferred.bind.

  • raises [Terminated]

    if w is terminated before deferred becomes determined.

module Expert : sig ... end