Module Await_in_asyncSource

Sourceval schedule_with_sync : ?monitor:Async.Monitor.t -> ?priority:Async.Priority.t -> (Await_kernel.Sync.t @ local -> 'a) @ once -> 'a Async.Deferred.t

schedule_with_sync ~f schedules f s as a concurrent task to run on the async scheduler with a s : Sync.t that will resume execution of the task after a blocking sync on the async scheduler.

Sourceval 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 concurrent task to run on the async scheduler with a w : Await.t that will resume execution of the task after a blocking await on the async scheduler.

Sourceval schedule_with_yield : ?monitor:Async.Monitor.t -> ?priority:Async.Priority.t -> (Await_kernel.Yield.t @ local -> 'a) @ once -> 'a Async.Deferred.t

schedule_with_yield ~f schedules f y as a concurrent task to run on the async scheduler with a y : Yield.t that will yield to the async scheduler on calls to Yield.yield

Sourceval run_with_sync : f:(Await_kernel.Sync.t @ local -> 'a) @ once -> 'a Async.Deferred.t

run_with_sync is like schedule_with_sync, except f is started immediately rather than enqueuing onto the async scheduler. run_with_sync must be called within the async scheduler.

Sourceval run_with_await : Await_kernel.Terminator.t -> f:(Await_kernel.Await.t @ local -> 'a) @ once -> 'a Async.Deferred.t

run_with_await is like schedule_with_await, except f is started immediately rather than enqueuing onto the async scheduler. run_with_await must be called within the async scheduler.

Sourceval await_deferred : Await_kernel.Await.t @ local -> 'a Async.Deferred.t -> 'a

await_deferred w deferred awaits until the deferred becomes determined.

  • raises [Terminated]

    if w is terminated before deferred becomes determined.

Sourceval non_eager_await_deferred : Await_kernel.Await.t @ local -> 'a Async.Deferred.t -> 'a

non_eager_await_deferred w deferred awaits until the deferred becomes determined. Unlike await_deferred, non_eager_await_deferred always resumes the current task 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.

Sourcemodule Expert : sig ... end