diff options
author | Arsentiy Milchakov <milcars@mapswithme.com> | 2017-08-14 14:16:42 +0300 |
---|---|---|
committer | Yuri Gorshenin <mipt.vi002@gmail.com> | 2017-08-14 15:37:42 +0300 |
commit | 6bf8b07db5e8f594407973ab336f2e118321f4ac (patch) | |
tree | 7e89d836def728f82df2eea623897431f1c875a0 /partners_api/uber_api.cpp | |
parent | 580e23357cac94b080cebf90910bfef0ce9991f0 (diff) |
[partners_api] use single network thread for all api
Diffstat (limited to 'partners_api/uber_api.cpp')
-rw-r--r-- | partners_api/uber_api.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/partners_api/uber_api.cpp b/partners_api/uber_api.cpp index 4896ed3acd..ed2cd67393 100644 --- a/partners_api/uber_api.cpp +++ b/partners_api/uber_api.cpp @@ -1,6 +1,8 @@ #include "partners_api/uber_api.hpp" #include "partners_api/utils.hpp" +#include "platform/platform.hpp" + #include "geometry/latlon.hpp" #include "base/logging.hpp" @@ -250,7 +252,7 @@ void Api::GetAvailableProducts(ms::LatLon const & from, ms::LatLon const & to, maker->Reset(reqId); - threads::SimpleThread([maker, from, reqId, baseUrl, successFn, errorFn]() + GetPlatform().RunOnNetworkThread([maker, from, reqId, baseUrl, successFn, errorFn]() { string result; if (!RawApi::GetEstimatedTime(from, result, baseUrl)) @@ -258,9 +260,9 @@ void Api::GetAvailableProducts(ms::LatLon const & from, ms::LatLon const & to, maker->SetTimes(reqId, result); maker->MakeProducts(reqId, successFn, errorFn); - }).detach(); + }); - threads::SimpleThread([maker, from, to, reqId, baseUrl, successFn, errorFn]() + GetPlatform().RunOnNetworkThread([maker, from, to, reqId, baseUrl, successFn, errorFn]() { string result; if (!RawApi::GetEstimatedPrice(from, to, result, baseUrl)) @@ -268,7 +270,7 @@ void Api::GetAvailableProducts(ms::LatLon const & from, ms::LatLon const & to, maker->SetPrices(reqId, result); maker->MakeProducts(reqId, successFn, errorFn); - }).detach(); + }); } RideRequestLinks Api::GetRideRequestLinks(string const & productId, ms::LatLon const & from, |