async_kernel icon indicating copy to clipboard operation
async_kernel copied to clipboard

waiting for a Deferred...

Open progman1 opened this issue 2 years ago • 1 comments

hello, is there a way to extract a result from a deferred? ie.

val await: 'a Deferred.t -> 'a

while this synchronous behaviour goes against the grain of Async, I have a piece of code I don't want to bend out of shape to fit into Async. in particular, this code is already running under the Async lock and I see this hypthetical function as merely about Async performing cycles until the offered deferred itself is determined and the function can then return the desired result. No busy waiting. I have a strong feeling this is already available in some form but I have not found it.

progman1 avatar Oct 08 '21 15:10 progman1