Skip to content
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

BugFix: ConcurrencyStrategy.wrapCallable was not being used on callbacks #190

Merged
merged 1 commit into from
Oct 2, 2013
Merged

BugFix: ConcurrencyStrategy.wrapCallable was not being used on callbacks #190

merged 1 commit into from
Oct 2, 2013

Conversation

benjchristensen
Copy link
Contributor

The Rx Scheduler now correctly has state transferred to it with ConcurrencyStrategy.wrapCallable.

Note that if the Rx sequence ever migrates to another thread (such as using observeOn) it is up to the user to deal with this as Hystrix loses control of the flow at that point.

This change does ensure though that the initial threads the callbacks are performed on has the expected thread context.

The design of this code is not very elegant and uses a workaround similar to posting variables on a stack before a method uses them. I have used this approach because I do not want to add a 'wrapFunc2' method to the ConcurrencyStrategy as the use of Func2 is just an implementation detail internally and the users of the library should not have to replicate the effort for both Callable and Func2. Thus the internal code is a little odd but the public API is untouched.

…ive event-loop threads.

The Rx Scheduler now correctly has state transferred to it with ConcurrencyStrategy.wrapCallable.

Note that if the Rx sequence ever migrates to another thread (such as using observeOn) it is up to the user to deal with this as Hystrix loses control of the flow at that point.

This change does ensure though that the initial threads the callbacks are performed on has the expected thread context.

The design of this code is not very elegant and uses a workaround similar to posting variables on a stack before a method uses them. I have used this approach because I do not want to add a 'wrapFunc2' method to the ConcurrencyStrategy as the use of Func2 is just an implementation detail internally and the users of the library should not have to replicate the effort for both Callable and Func2. Thus the internal code is a little odd but the public API is untouched.
@cloudbees-pull-request-builder

Hystrix-pull-requests #54 SUCCESS
This pull request looks good

@benjchristensen
Copy link
Contributor Author

Great, I'll merge and release this then. Thanks @daveray for the review and test.

I'll likely include #189 in the same release.

benjchristensen added a commit that referenced this pull request Oct 2, 2013
BugFix: ConcurrencyStrategy.wrapCallable was not being used on callbacks
@benjchristensen benjchristensen merged commit a7ac398 into Netflix:master Oct 2, 2013
@benjchristensen benjchristensen deleted the concurrencyStrategyWithRx branch October 2, 2013 06:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants