Skip to content

Instantly share code, notes, and snippets.

@mchlstckl mchlstckl/UserService.kt
Last active Jan 7, 2016

Embed
What would you like to do?
HystrixCommand returning Observable
//...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
You can’t perform that action at this time.