WhenAnyValue - how to ensure the order of async subscriber? #3710
Answered
by
sinatrocious
sinatrocious
asked this question in
Q&A
-
I've following code: SomeReactive.WhenAnyValue(o => o.SomeBool).Subscribe(async someBool =>
{
if(someBool)
{
await ...
Start();
}
else
{
await ...
Stop();
}
}); If
Is there a way to "prevent next call of subscriber, until previous is finished"? I can use P.S.: I asked this question on StackOverflow earlier. |
Beta Was this translation helpful? Give feedback.
Answered by
sinatrocious
Jan 15, 2024
Replies: 1 comment 4 replies
-
If I was trying to do this I would use
Hopefully this works in your situation. |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@anaisbetts,
async void
is the problem indeed. I've seen your answer in SO topic, where Stephen Cleary explains it ;)I will use
SubscribeAsync
in place ofSubscribe
: