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

Method Request

library/cpp/neh/neh.cpp:107–133  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

105}
106
107THandleRef NNeh::Request(const TMessage& msg, IOnRecv* fallback) {
108 TServiceStatRef ss;
109
110 if (TServiceStat::Disabled()) {
111 return ProtocolForMessage(msg)->ScheduleRequest(msg, fallback, ss);
112 }
113
114 ss = GetServiceStat(msg.Addr);
115 TServiceStat::EStatus es = ss->GetStatus();
116
117 if (es == TServiceStat::Ok) {
118 return ProtocolForMessage(msg)->ScheduleRequest(msg, fallback, ss);
119 }
120
121 if (es == TServiceStat::ReTry) {
122 //send empty data request for validating service (update TServiceStat info)
123 TMessage validator;
124
125 validator.Addr = msg.Addr;
126
127 ProtocolForMessage(msg)->ScheduleRequest(validator, nullptr, ss);
128 }
129
130 TNotifyHandleRef h(new TNotifyHandle(fallback, msg));
131 h->NotifyError(new TError(svcFail));
132 return h.Get();
133}
134
135THandleRef NNeh::Request(const TString& req, IOnRecv* fallback) {
136 return Request(TMessage::FromString(req), fallback);

Callers 1

Y_UNIT_TESTFunction · 0.45

Calls 7

ProtocolForMessageFunction · 0.85
RequestFunction · 0.70
FromStringFunction · 0.50
ScheduleRequestMethod · 0.45
GetStatusMethod · 0.45
NotifyErrorMethod · 0.45
GetMethod · 0.45

Tested by

no test coverage detected