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

Method ServeRequest

library/cpp/neh/neh_ut.cpp:43–58  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

41 }
42
43 void ServeRequest(const IRequestRef& req) {
44 if (req->Data() == TStringBuf("test_cancel")) {
45 ReceiveTestCancel = true;
46 for (size_t i = 0; i < 100; ++i) {
47 if (req->Canceled()) {
48 Canceled = true;
49 return;
50 }
51 Sleep(TDuration::MilliSeconds(10));
52 }
53 } else if (req->Data() == TStringBuf("test_error_InternalError")) {
54 req->SendError(IRequest::InternalError, INTERNAL_ERROR_DETAILS);
55 }
56 TData res(R_.data(), R_.data() + R_.size());
57 req->SendReply(res);
58 }
59
60 void ResetLastReqState() {
61 ReceiveTestCancel = false;

Callers

nothing calls this directly

Calls 8

SleepFunction · 0.85
MilliSecondsFunction · 0.85
DataMethod · 0.45
CanceledMethod · 0.45
SendErrorMethod · 0.45
dataMethod · 0.45
sizeMethod · 0.45
SendReplyMethod · 0.45

Tested by

no test coverage detected