Last active
January 7, 2016 19:22
-
-
Save mchlstckl/5f90b7d82e991e224a9a to your computer and use it in GitHub Desktop.
HystrixCommand returning Observable
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//...elided code...// | |
@HystrixCommand(/* ...some very advanced hystrix configurations here... */) | |
open fun fetchUser(email: String): Observable<User> { | |
// MUST return ObservableResult when using @HystrixCommand and Observable<T> | |
// See: https://github.com/Netflix/Hystrix/issues/729 | |
return object : ObservableResult<User>() { | |
override fun invoke() = client.fetchUser(email) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment