MCPcopy Create free account
hub / github.com/Artikash/Textractor / SendRequest

Function SendRequest

extensions/devtools.cpp:164–173  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

162 }
163
164 JSON::Value<wchar_t> SendRequest(const char* method, const std::wstring& params)
165 {
166 concurrency::task_completion_event<JSON::Value<wchar_t>> response;
167 int id = idCounter += 1;
168 if (!Connected()) return {};
169 mapQueue->try_emplace(id, response);
170 QMetaObject::invokeMethod(&webSocket, std::bind(&QWebSocket::sendTextMessage, &webSocket, S(FormatString(LR"({"id":%d,"method":"%S","params":%s})", id, method, params))));
171 try { if (auto result = create_task(response).get()[L"result"]) return result; } catch (...) {}
172 return {};
173 }
174}

Callers 3

TranslateFunction · 0.85
TranslateFunction · 0.85
TranslateFunction · 0.85

Calls 3

ConnectedFunction · 0.85
SFunction · 0.85
FormatStringFunction · 0.85

Tested by

no test coverage detected