You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi there. I am trying to build Async Tasks for our elmish application. I want to execute two async request in parallel and apply their responses to my results (applicative style). My problem is that I need to start two (or more) different Asyncs in parallel and I can not use Async.Parallel because the Asyncs are wrapping different Result Types. The problem is, that Async.StartChild does not seem to be implemented in Fable but I do not get any compile Errors or warnings in the browser dev tools.
The async requests are just never executed. Does anybody have a hint how to achieve what I want?
Repro code
type Task<'Result, 'Error> =
Async<Result<'Result, 'Error>>
let private (<!>) = Result.map
let private (<*>) = Result.apply
let map2Parallel func taskA taskB =
async {
let! result1Async = taskA |> Async.StartChild // start first request but do not wait
let! result2Async = taskB |> Async.StartChild // start second request in parallel
let! result1 = result1Async
let! result2 = result2Async
let result =
func <!> result1 <*> result2
return result
}
Expected and actual results
Expected: Both async operations are started.
Actual: Nothing happens and there is neither a compile error nor a warning/error in the browser console
The text was updated successfully, but these errors were encountered:
Description
Hi there. I am trying to build Async Tasks for our elmish application. I want to execute two async request in parallel and apply their responses to my results (applicative style). My problem is that I need to start two (or more) different Asyncs in parallel and I can not use Async.Parallel because the Asyncs are wrapping different Result Types. The problem is, that Async.StartChild does not seem to be implemented in Fable but I do not get any compile Errors or warnings in the browser dev tools.
The async requests are just never executed. Does anybody have a hint how to achieve what I want?
Repro code
Expected and actual results
Expected: Both async operations are started.
Actual: Nothing happens and there is neither a compile error nor a warning/error in the browser console
The text was updated successfully, but these errors were encountered: