HystrixObservableCommand.run() Method Name
Should this method still be called run(), or something else since it actually does not "run" anything, but just retrieves the Observable<T> that will later be run?
This needs to be decided before the final 1.4.0 release.
The pattern i've been using for commands which return an Observable (and don't actually run) is to call them, prepareX(). X being the action they are preparing, so in this case, it would be prepareRun()
There may be a better convention for reactive commands though that I am not aware of. :) But I agree it should be renamed to reduce confusion.
get() or getObservable()?
Either of those would work for me. So it seems options are:
get()getObservable()prepare()prepareRun()prepareObservable()create()
observe() or create() would be my vote. The class name implies that you're creating an observable, so I don't think you need to include 'observable' in the method name. Unless you think it removes ambiguity when compared to the other Hystrix Commands.
What about construct()? Like a constructor, you pass it arguments, but don't expect anything to run until you call other methods.
construct() sounds good too.
+1 for construct(), I think this best expresses the behavior of the method.
I like construct() as well.