FastLED 3.10.9
Loading...
Searching...
No Matches

◆ update()

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

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

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

351 {
352 size_t processed = Server::pull(); // Pull requests from Server
353 size_t executed = tick(currentTimeMs); // Process scheduled tasks
354
355#if FL_PLATFORM_HAS_LARGE_MEMORY
356 // Push scheduled results as JSON-RPC responses. Gated on Low-memory
357 // because mResults is dropped there (see #3224 Tier 1B).
358 for (const auto& r : mResults) {
359 fl::json response = fl::json::object();
360 response.set("result", r.result);
361 // Note: We don't have the original request ID for scheduled calls
362 // This could be improved by storing the ID with RpcResult
363 mOutgoingQueue.push_back(response);
364 }
365#endif
366
367 size_t sent = Server::push(); // Push responses from Server
368 return processed + executed + sent;
369}
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:864

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: