{"action":"created","issue":{"url":"https://api.github.com/repos/Netflix/Hystrix/issues/1201","repository_url":"https://api.github.com/repos/Netflix/Hystrix","labels_url":"https://api.github.com/repos/Netflix/Hystrix/issues/1201/labels{/name}","comments_url":"https://api.github.com/repos/Netflix/Hystrix/issues/1201/comments","events_url":"https://api.github.com/repos/Netflix/Hystrix/issues/1201/events","html_url":"https://github.com/Netflix/Hystrix/issues/1201","id":153410977,"number":1201,"title":"Rx Async execution","user":{"login":"bertvh","id":941577,"avatar_url":"https://avatars.githubusercontent.com/u/941577?v=3","gravatar_id":"","url":"https://api.github.com/users/bertvh","html_url":"https://github.com/bertvh","followers_url":"https://api.github.com/users/bertvh/followers","following_url":"https://api.github.com/users/bertvh/following{/other_user}","gists_url":"https://api.github.com/users/bertvh/gists{/gist_id}","starred_url":"https://api.github.com/users/bertvh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bertvh/subscriptions","organizations_url":"https://api.github.com/users/bertvh/orgs","repos_url":"https://api.github.com/users/bertvh/repos","events_url":"https://api.github.com/users/bertvh/events{/privacy}","received_events_url":"https://api.github.com/users/bertvh/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-05-06T09:11:54Z","updated_at":"2016-05-09T16:31:01Z","closed_at":null,"body":"I want to execute a Hystrix command asynchronously, I'm not interested in the results in the thread I'm launching the command from. I'm using Javanica.\r\n\r\n    @HystrixCommand(observableExecutionMode = LAZY)\r\n    public final Observable<Boolean> doSomething() {\r\n      return Observable.create(new Observable.OnSubscribe<Boolean>() {\r\n        @Override\r\n            public void call(Subscriber<? super Boolean> subscriber) {\r\n              // Call an external system\r\n              subscriber.onNext(true);\r\n              subscriber.onCompleted();\r\n            }\r\n      }\r\n    }\r\n\r\nNow I would think executing this would be asynchronous (returns immediately), however it doesn't:\r\n\r\n    doSomething().subscribe(/*do some logging*/); \r\n\r\nWhat does work is this:\r\n\r\n    observable().subscribeOn(Schedulers.io()).subscribe(/*do some logging*/);\r\n\r\nHowever, I'm afraid I'm messing with the threading introduced by Hystrix here. I'm really confused on what to do there. Any suggestions?\r\n\r\nEDIT: ~~indeed, when subscribing on the io() thread, Hystrix does not time out.~~\r\nEDIT2: Wrong.. it does time out!"},"comment":{"url":"https://api.github.com/repos/Netflix/Hystrix/issues/comments/217915963","html_url":"https://github.com/Netflix/Hystrix/issues/1201#issuecomment-217915963","issue_url":"https://api.github.com/repos/Netflix/Hystrix/issues/1201","id":217915963,"user":{"login":"mattrjacobs","id":205579,"avatar_url":"https://avatars.githubusercontent.com/u/205579?v=3","gravatar_id":"","url":"https://api.github.com/users/mattrjacobs","html_url":"https://github.com/mattrjacobs","followers_url":"https://api.github.com/users/mattrjacobs/followers","following_url":"https://api.github.com/users/mattrjacobs/following{/other_user}","gists_url":"https://api.github.com/users/mattrjacobs/gists{/gist_id}","starred_url":"https://api.github.com/users/mattrjacobs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattrjacobs/subscriptions","organizations_url":"https://api.github.com/users/mattrjacobs/orgs","repos_url":"https://api.github.com/users/mattrjacobs/repos","events_url":"https://api.github.com/users/mattrjacobs/events{/privacy}","received_events_url":"https://api.github.com/users/mattrjacobs/received_events","type":"User","site_admin":false},"created_at":"2016-05-09T16:31:01Z","updated_at":"2016-05-09T16:31:01Z","body":"In the uppermost-example, the Observable you're creating is synchronous.  Therefore, when Hystrix wraps a synchronous call, the result of that will also be synchronous.\r\n\r\nIf you put the call to `subscribeOn` in the Observable that Hystrix wraps, then you'll get an async command"}}