-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Fix/1252 driver scheduling #1253
Fix/1252 driver scheduling #1253
Conversation
Why can't we instead use Here is my proposed solution, which I'll make into a PR if needed: master...brentleyjones:sharedSequence-subscriptionScheduler |
@brentleyjones 🤔 actually Driver used to have However, even in Swift 2.3 I used to have issues with |
|
Generated by 🚫 Danger |
Yep, @brentleyjones I've just figured that out also :D I changed my test to use Driver which is transformed from So... basically your changes won't fix my issue 😉 |
Hi @TheAdamBorek @brentleyjones , I think there could be some issues if you are using Having said that, I think we might investigate adding another customization point in RxSwift 4.0 like we had in previous version I don't think this would cause any performance concerns since @brentleyjones the reason why we can't add this now is because adding this to |
@brentleyjones could you for now try this PR and tell us if this solves your issue and maybe make a PR for 4.0 version? |
@kzaher I'll check it out after lunch 😄. |
@kzaher It works. I do wonder if using Though, again, it currently works for me, so I'm 👍 😄. |
I've been thinking about what are the other consequences of changing this. The nice thing about the previous solution with shared instance was that there wasn't any reentrancy possible in On the other hand it did cause these async dispatches unpredictably. I'm still for merging this thing. I'm just trying to consider all of the effects of this change. One will probably be us needing to add another We will also try to improve that reentrancy code. I'll try to think about how to best adapt it. |
So @kzaher do you want to me to fix anything in the PR? Are code style, tests written ok? |
Hi @TheAdamBorek , I was just thinking a bit. Merged this. Made some changes to unit tests 8e6d467. |
This is the PR which fixes #1252
As we discussed the issue on RxSwift's slack, the reason of the issue is all the Drivers share the same instance of
MainScheduler
.The solution is to use different scheduler instances for Drivers.
MainScheduler.instance
still returns a shared instance of the scheduler, so it is possible to have similar issue if people will useobserveOn(MainScheduler.instance)
on Observables. @kzaher I'm thinking if this is ok 🤔