| 270 | // Server Coordination |
| 271 | |
| 272 | size_t Remote::update(u32 currentTimeMs) { |
| 273 | size_t processed = Server::pull(); // Pull requests from Server |
| 274 | size_t executed = tick(currentTimeMs); // Process scheduled tasks |
| 275 | |
| 276 | // Push scheduled results as JSON-RPC responses |
| 277 | for (const auto& r : mResults) { |
| 278 | fl::json response = fl::json::object(); |
| 279 | response.set("result", r.result); |
| 280 | // Note: We don't have the original request ID for scheduled calls |
| 281 | // This could be improved by storing the ID with RpcResult |
| 282 | mOutgoingQueue.push_back(response); |
| 283 | } |
| 284 | |
| 285 | size_t sent = Server::push(); // Push responses from Server |
| 286 | return processed + executed + sent; |
| 287 | } |
| 288 | |
| 289 | // Schema Methods |
| 290 | |