FastLED 3.10.8
Loading...
Searching...
No Matches

◆ update()

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

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

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

348 {
349 size_t processed = Server::pull(); // Pull requests from Server
350 size_t executed = tick(currentTimeMs); // Process scheduled tasks
351
352#if FL_PLATFORM_HAS_LARGE_MEMORY
353 // Push scheduled results as JSON-RPC responses. Gated on Low-memory
354 // because mResults is dropped there (see #3224 Tier 1B).
355 for (const auto& r : mResults) {
356 fl::json response = fl::json::object();
357 response.set("result", r.result);
358 // Note: We don't have the original request ID for scheduled calls
359 // This could be improved by storing the ID with RpcResult
360 mOutgoingQueue.push_back(response);
361 }
362#endif
363
364 size_t sent = Server::push(); // Push responses from Server
365 return processed + executed + sent;
366}
size_t tick(u32 currentTimeMs) FL_NO_EXCEPT
Process scheduled calls (call regularly)
fl::vector< fl::json > mOutgoingQueue
Definition server.h:104
size_t pull() FL_NO_EXCEPT
Pull requests from source, process, queue responses.
size_t push() FL_NO_EXCEPT
Push queued responses to sink.
static json object() FL_NO_EXCEPT
Definition json.h:857

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

Referenced by autoResearchLowMemoryLoop().

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