| 56 | } |
| 57 | |
| 58 | void Remote::sendStreamUpdate(const char* method, const fl::json& update) { |
| 59 | fl::string methodName(method); |
| 60 | auto it = mAsyncRequests.find(methodName); |
| 61 | if (it == mAsyncRequests.end()) { |
| 62 | FL_WARN("No pending async request for method: " << method); |
| 63 | return; |
| 64 | } |
| 65 | |
| 66 | int requestId = it->second.requestId; |
| 67 | // Don't erase - stream is still active |
| 68 | |
| 69 | // Build JSON-RPC response with "update" marker |
| 70 | fl::json response = fl::json::object(); |
| 71 | response.set("jsonrpc", "2.0"); |
| 72 | response.set("id", requestId); |
| 73 | |
| 74 | fl::json resultObj = fl::json::object(); |
| 75 | resultObj.set("update", update); |
| 76 | response.set("result", resultObj); |
| 77 | |
| 78 | // Send via response sink |
| 79 | if (mResponseSink) { |
| 80 | mResponseSink(response); |
| 81 | FL_DBG("Sent stream update for " << method << " (id=" << requestId << ")"); |
| 82 | } |
| 83 | } |
| 84 | |
| 85 | void Remote::sendStreamFinal(const char* method, const fl::json& result) { |
| 86 | fl::string methodName(method); |