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

Method TRequestServer

library/cpp/neh/http_ut.cpp:26–36  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

24 class TRequestServer {
25 public:
26 TRequestServer(std::function<void(const IRequestRef&)> f = [](const IRequestRef& req) {
27 TDataSaver responseData;
28 Sleep(TDuration::MilliSeconds(FromString<int>(req->Data())));
29 responseData << req->Data();
30 auto* httpReq = dynamic_cast<IHttpRequest*>(req.Get());
31 TString headers = "\r\nContent-Type: text/plain";
32 httpReq->SendReply(responseData, headers);
33 })
34 : F_(f)
35 {
36 }
37
38 void ServeRequest(const IRequestRef& req) {
39 F_(req);

Callers

nothing calls this directly

Calls 5

SleepFunction · 0.85
MilliSecondsFunction · 0.85
DataMethod · 0.45
GetMethod · 0.45
SendReplyMethod · 0.45

Tested by

no test coverage detected