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
Context scheduler #28
Conversation
If you call an observable that calls back on a different thread the offload via observeOn (Scheduler) does not return on the correct thread. In our case we were calling couchbase rxApi for inserting ext and it returns on an internal thread. Offloading it makes scense so we do not pollute our vertx thread with couchbase threads. In this case we get the wrong thread back and it causes some erratic bahaviour later on. @see SchedulerTest.java:testScheduleObserveOnReturnsOnCorrectThread @see ContextScheduler.java
@vietj I do have some suggestions to reduce the blocking of the ContextScheduler class. Might need some performance style tests to see if it actually is worth putting in though. |
@vietj Im not sure about the blocking side that you requested changes for though ? |
@kevlarC don't mind about the blocking side, it was an odd suggestion |
@kevlarC yes provide another PR |
@kevlarC what do you mean by X thread ? the test uses new Thread() { ... } it's not a Vert.x thread |
btw do you know you can comment inline on the commits, it would be easier rather than pointing the line :-) ? |
It took a little bit more review and I like the tests they are a bit simpler. Although a little less 'life like' 😉 . Otherwise it looks good to me |
Community patch by @kevlarC + improvements.
@kevlarC would you mind to review the pull request please ?