Companion object of Async, but with a type parameter to allow fine grained type inference.
This could potentially be simplified if we ever get named type parameters.
Main async syntax. The body expr is not executed until the returned Async is started with delay.run or one of the variants. Any exceptions raised in expr are forwarded to the handler of the async run.
Main async syntax. The body expr is not executed until the returned Async is started with delay.run or one of the variants. Any exceptions raised in expr are forwarded to the handler of the async run.
inline def resource[R, A](inline open: R, inline close: R => Unit)(inline body: Ctx ?=> R => A): Async[Ctx, A]
Simple form of resource handling given an open and close function for some resource.
Makes the resource available inside the async body and ensures it is closed as soon as body is done (exceptionally or normally).
Simple form of resource handling given an open and close function for some resource.
Makes the resource available inside the async body and ensures it is closed as soon as body is done (exceptionally or normally).