EventsHandler: Drop superfluous `CpuBoundWork` usage

This commit is contained in:
Yonas Habteab 2024-02-09 12:00:50 +01:00
parent 72266434df
commit 32531fe909
1 changed files with 0 additions and 4 deletions

View File

@ -116,16 +116,12 @@ bool EventsHandler::HandleRequest(
auto event (subscriber.GetInbox()->Shift(yc)); auto event (subscriber.GetInbox()->Shift(yc));
if (event) { if (event) {
CpuBoundWork buildingResponse (yc);
String body = JsonEncode(event); String body = JsonEncode(event);
boost::algorithm::replace_all(body, "\n", ""); boost::algorithm::replace_all(body, "\n", "");
asio::const_buffer payload (body.CStr(), body.GetLength()); asio::const_buffer payload (body.CStr(), body.GetLength());
buildingResponse.Done();
asio::async_write(stream, payload, yc); asio::async_write(stream, payload, yc);
asio::async_write(stream, newLine, yc); asio::async_write(stream, newLine, yc);
stream.async_flush(yc); stream.async_flush(yc);