FastLED 3.9.15
Loading...
Searching...
No Matches

◆ update()

size_t fl::Remote::update ( u32 currentTimeMs)

Main update: pull + tick + push (overrides Server::update)

Definition at line 272 of file remote.cpp.hpp.

272 {
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}
size_t tick(u32 currentTimeMs)
Process scheduled calls (call regularly)
fl::vector< RpcResult > mResults
Definition remote.h:212
size_t push()
Push queued responses to sink.
fl::vector< fl::json > mOutgoingQueue
Definition server.h:91
size_t pull()
Pull requests from source, process, queue responses.
static json object() FL_NOEXCEPT
Definition json.h:692

References fl::Server::mOutgoingQueue, mResults, fl::json::object(), fl::Server::pull(), fl::Server::push(), and tick().

Referenced by autoResearchLowMemoryLoop(), and sendStreamUpdate().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: