我在这里有点腌渍。我似乎无法在计算的每一步做回调异步工作流程。这是我的代码
let criteria: state -> state -> bool = ...//criteria definition
let callback: state -> unit = ..../callback definition
let rec compute task state =
async{
....// some long computations
let task' = task.ContinueWith(fun _ ->callback(newState))
if criteria state newState then return newState
else return! compute task' newState
}