Closed nah0y closed 6 years ago
Use Promise.Race.
You can read about it in my article: http://www.what-could-possibly-go-wrong.com/promises-for-game-development/
"Race is similar to All, but it resolves immediately when the first inner promise resolves. Each of the promises are racing each other for completion." This is not what I want. I want all of my promises to resolve, but just the first one first, then the second, then the third etc...
Sorry I meant Promise.Sequence!! Again check my article.
I haven't used C# promises for almost a year now!
Seems like what I'm looking for thanks! Again sorry, in my head there were only All and Race...
Hello again :)
I have this bit of code:
But as the doc says, it will run all my promises in parallel. Also, it seems that even if I don't call WriteCharacteristicInternal, it will trigger the promise. So I don't really understand why in the doc it says that Promise.All will run them all in parallel, as they are already started just by calling the WriteCharacteristicInternal method. Anyway :) Is there a "native" way of saying that I want to run an array of promises in sequence? Waiting for one to finish, then start the other etc... without having to do that "manually" in multiple .Then?
Thanks!