MCPcopy Create free account
hub / github.com/EmmyLua/EmmyLuaDebugger / OnAsyncWrite

Method OnAsyncWrite

emmy_debugger/src/transporter/transporter.cpp:165–178  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

163}
164
165void Transporter::OnAsyncWrite(uv_async_t* handle)
166{
167 auto* self = static_cast<Transporter*>(handle->data);
168 std::queue<WriteRequest*> pending;
169 {
170 std::lock_guard<std::mutex> lock(self->writeMtx);
171 std::swap(pending, self->writeQueue);
172 }
173 while (!pending.empty()) {
174 auto* writeReq = pending.front();
175 pending.pop();
176 uv_write(&writeReq->req, writeReq->handler, &writeReq->buf, 1, AfterWrite);
177 }
178}
179
180void Transporter::Send(uv_stream_t* handler, int cmd, const char* data, size_t len)
181{

Callers

nothing calls this directly

Calls 3

swapFunction · 0.85
uv_writeFunction · 0.50
emptyMethod · 0.45

Tested by

no test coverage detected