-
Notifications
You must be signed in to change notification settings - Fork 59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Thread safety in Observable.Delay #779
Comments
Sorry, I think I don't understand the issue. The |
I test the code, and the output does confirm that the code in subscribe body was executed in |
But this is how the |
This is the problem I mentioned in second paragraph
|
Can you provide an example of how you would write the code in that case? |
Like this?
|
Thanks! Here are a few points.
or
|
Thanks for the information. I have to admit that |
delay
method usesScheduler
parameter to execute not only the delay operation, but also the subscribe body. Different thread context could result in potential race problem.To keep same thread context after delay, a
Scheduler
which schedule in current thread context is needed. But current library doesn't provide a straightforward way to create suchScheduler
The text was updated successfully, but these errors were encountered: