I have the following:
do!
[
[
TradesDatabase.deleteTradesAsync credentials time (time.Add oneDay)
TradesDatabase.insertTradesAsync credentials trades
] |> Async.Sequential
[
KVWAPDatabase.deleteKVWAPAsync credentials time (time.Add oneDay)
KVWAPDatabase.insertKVWAPAsync credentials output.KVWAP
] |> Async.Sequential
[
CandlesDatabase.deleteCandlesAsync credentials time (time.Add oneDay)
CandlesDatabase.insertCandlesAsync credentials output.Candles
] |> Async.Sequential
]
|> Async.Parallel
|> Async.Ignore
The inner code is probably not very useful, these are async db calls.
So for 3 data types I want to process in parallel, I want to do a sequential delete following by an insert.
But the debug's printout is:
delete kvwap <- called by deleteKVWAPAsync
inserting kvwap <- called by insertKVWAPAsync
done deleting kvwap <- called by deleteKVWAPAsync
so this block:
[
KVWAPDatabase.deleteKVWAPAsync credentials time (time.Add oneDay)
KVWAPDatabase.insertKVWAPAsync credentials output.KVWAP
] |> Async.Sequential
was supposed to be executed in order, but it's not.
What am I missing regarding Async.Sequential?
Async.Sleepin thedeletestep. I suspect that maybe you've accidentally copy/pasted thekvwapdebug output into one of the other parallel branches (either Trades or Candles) without changing the output text?asyncCE and FusionTasks NuGet and call your async code inside the CE?