Call async method in an inner lambda?

ساخت وبلاگ

Vote count: 0

I have the following code

let rec consume() : Async<unit> = async { ..... listA |> Seq.iter(fun i -> ..... let listB : seq<...> option = let c = getListB a b match c with | Some d -> Seq.filter(....) |> Some | None -> None 

Now the function getListB is converted to retu async<Seq<B>> instead of Seq<B>. So the code was converted to the following. However, the getListB blocked the execution. How to rewrite it nonblocking? Simply convert the line to let! c = getListB a b won't work because the code is in an inner lambda.

let rec consume() : Async<unit> = async { ..... listA |> Seq.iter(fun i -> ..... let listB : seq<...> option = let c = getListB a b |> Async.RunSynchronously match c with | Some d -> Seq.filter(....) |> Some | None -> None 
asked 12 secs ago

back soft...
ما را در سایت back soft دنبال می کنید

برچسب : نویسنده : استخدام کار backsoft بازدید : 265 تاريخ : دوشنبه 28 تير 1395 ساعت: 22:54