I am worried that my previous answer was not quite what you want. What I put just caused a compilation error. But one thing about this is that it does not start asynchronously. Task.Waitand Async.RunSynchronouslywill block the current thread until the operation is completed.
, , , , , async, async op . ,
let someFunction (req : HttpRequestMesssage) a b =
async {
let! readToProvider = (req.Content.ReadAsMultipartAsync provider) |> Async.AwaitIAsyncResult
return req.CreateResponse HttpStatusCode.OK
}
, Async<Response>. , , , , - .
, -, , (, async Task , .net - #), . , async op, do! someFunction ..., . , , someFunction ... |> Async.RunSynchronously. , . let someFunctionSync ... = someFunction ... |> Async.RunSynchronously, .
, .