MCPcopy Create free account
hub / github.com/catboost/catboost / ServeRequest

Method ServeRequest

library/cpp/neh/rpc.cpp:188–215  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

186 };
187
188 inline void ServeRequest(TVersionedServiceMap& mp, IRequestRef req) {
189 if (!req) {
190 return;
191 }
192
193 const TStringBuf name = req->Service();
194 TSrvs::const_iterator it = mp.Srvs.find(name);
195
196 if (Y_UNLIKELY(it == mp.Srvs.end())) {
197 if (UpdateServices(mp.Srvs, mp.Version)) {
198 it = mp.Srvs.find(name);
199 }
200 }
201
202 if (Y_UNLIKELY(it == mp.Srvs.end())) {
203 it = mp.Srvs.find(TStringBuf("*"));
204 }
205
206 if (Y_UNLIKELY(it == mp.Srvs.end())) {
207 req->SendError(IRequest::NotExistService);
208 } else {
209 try {
210 it->second->ServeRequest(req);
211 } catch (...) {
212 Cdbg << CurrentExceptionMessage() << Endl;
213 }
214 }
215 }
216
217 inline bool UpdateServices(TSrvs& srvs, i64& version) const {
218 if (SelfVersion_.load() == version) {

Callers

nothing calls this directly

Calls 6

CurrentExceptionMessageFunction · 0.85
ServiceMethod · 0.45
findMethod · 0.45
endMethod · 0.45
SendErrorMethod · 0.45
ServeRequestMethod · 0.45

Tested by

no test coverage detected