| 32 | // Async Response Support |
| 33 | |
| 34 | void Remote::sendAsyncResponse(const char* method, const fl::json& result) { |
| 35 | fl::string methodName(method); |
| 36 | auto it = mAsyncRequests.find(methodName); |
| 37 | if (it == mAsyncRequests.end()) { |
| 38 | FL_WARN("No pending async request for method: " << method); |
| 39 | return; |
| 40 | } |
| 41 | |
| 42 | int requestId = it->second.requestId; |
| 43 | mAsyncRequests.erase(it); |
| 44 | |
| 45 | // Build JSON-RPC response |
| 46 | fl::json response = fl::json::object(); |
| 47 | response.set("jsonrpc", "2.0"); |
| 48 | response.set("id", requestId); |
| 49 | response.set("result", result); |
| 50 | |
| 51 | // Send via response sink |
| 52 | if (mResponseSink) { |
| 53 | mResponseSink(response); |
| 54 | FL_DBG("Sent async response for " << method << " (id=" << requestId << ")"); |
| 55 | } |
| 56 | } |
| 57 | |
| 58 | void Remote::sendStreamUpdate(const char* method, const fl::json& update) { |
| 59 | fl::string methodName(method); |
no test coverage detected