{"action":"created","issue":{"url":"https://api.github.com/repos/ashfurrow/Moya/issues/163","labels_url":"https://api.github.com/repos/ashfurrow/Moya/issues/163/labels{/name}","comments_url":"https://api.github.com/repos/ashfurrow/Moya/issues/163/comments","events_url":"https://api.github.com/repos/ashfurrow/Moya/issues/163/events","html_url":"https://github.com/ashfurrow/Moya/issues/163","id":93207465,"number":163,"title":"RxSwift extensions question","user":{"login":"kzaher","id":1641148,"avatar_url":"https://avatars.githubusercontent.com/u/1641148?v=3","gravatar_id":"","url":"https://api.github.com/users/kzaher","html_url":"https://github.com/kzaher","followers_url":"https://api.github.com/users/kzaher/followers","following_url":"https://api.github.com/users/kzaher/following{/other_user}","gists_url":"https://api.github.com/users/kzaher/gists{/gist_id}","starred_url":"https://api.github.com/users/kzaher/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kzaher/subscriptions","organizations_url":"https://api.github.com/users/kzaher/orgs","repos_url":"https://api.github.com/users/kzaher/repos","events_url":"https://api.github.com/users/kzaher/events{/privacy}","received_events_url":"https://api.github.com/users/kzaher/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"alcarvalho","id":1180701,"avatar_url":"https://avatars.githubusercontent.com/u/1180701?v=3","gravatar_id":"","url":"https://api.github.com/users/alcarvalho","html_url":"https://github.com/alcarvalho","followers_url":"https://api.github.com/users/alcarvalho/followers","following_url":"https://api.github.com/users/alcarvalho/following{/other_user}","gists_url":"https://api.github.com/users/alcarvalho/gists{/gist_id}","starred_url":"https://api.github.com/users/alcarvalho/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alcarvalho/subscriptions","organizations_url":"https://api.github.com/users/alcarvalho/orgs","repos_url":"https://api.github.com/users/alcarvalho/repos","events_url":"https://api.github.com/users/alcarvalho/events{/privacy}","received_events_url":"https://api.github.com/users/alcarvalho/received_events","type":"User","site_admin":false},"milestone":null,"comments":2,"created_at":"2015-07-06T07:10:48Z","updated_at":"2015-07-07T14:42:44Z","closed_at":null,"body":"Hi Ash,\r\n\r\nI've seen this some time ago, but was swamped :)\r\n\r\nI think there is a threading concern [here](https://github.com/ashfurrow/Moya/blob/master/Moya/RxSwift/Moya%2BRxSwift.swift#L20)\r\n```\r\n            if let existingObservable = self?.inflightRequests[endpoint] {\r\n                return existingObservable\r\n            }\r\n```\r\n\r\nWe should probably use \r\n```\r\n            objc_sync_enter(weakSelf)\r\n            let inFlight = self?.inflightRequests[endpoint]\r\n            objc_sync_exit(weakSelf)\r\n            if let existingObservable = inFlight {\r\n                return existingObservable\r\n            }\r\n```\r\n\r\nIt looks like ReactiveCocoa integration has the same [issue](https://github.com/ashfurrow/Moya/blob/master/Moya/ReactiveCocoa/Moya%2BReactiveCocoa.swift#L24)\r\n\r\nIf you want, I can make a PR, but just wanted to be sure this is a bug.\r\n\r\nI think we are also [missing](https://github.com/ashfurrow/Moya/blob/master/Moya/RxSwift/Moya%2BRxSwift.swift#L38) sharing of a result construct (`>- variable`), I can add that also."},"comment":{"url":"https://api.github.com/repos/ashfurrow/Moya/issues/comments/119225000","html_url":"https://github.com/ashfurrow/Moya/issues/163#issuecomment-119225000","issue_url":"https://api.github.com/repos/ashfurrow/Moya/issues/163","id":119225000,"user":{"login":"ashfurrow","id":498212,"avatar_url":"https://avatars.githubusercontent.com/u/498212?v=3","gravatar_id":"","url":"https://api.github.com/users/ashfurrow","html_url":"https://github.com/ashfurrow","followers_url":"https://api.github.com/users/ashfurrow/followers","following_url":"https://api.github.com/users/ashfurrow/following{/other_user}","gists_url":"https://api.github.com/users/ashfurrow/gists{/gist_id}","starred_url":"https://api.github.com/users/ashfurrow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ashfurrow/subscriptions","organizations_url":"https://api.github.com/users/ashfurrow/orgs","repos_url":"https://api.github.com/users/ashfurrow/repos","events_url":"https://api.github.com/users/ashfurrow/events{/privacy}","received_events_url":"https://api.github.com/users/ashfurrow/received_events","type":"User","site_admin":false},"created_at":"2015-07-07T14:42:44Z","updated_at":"2015-07-07T14:42:44Z","body":"Thanks for bringing up the issue, @kzaher – good catch! Hand't considered the signals coming from other threads >.<\r\n\r\n@alcarvalho Thanks for the help! It's a tricky problem and a _very_ difficult use case to test. Could I ask you to open a pull request, with your work and new tests? We can have a conversation about it there :fireworks: "}}