MCPcopy Create free account
hub / github.com/FastLED/FastLED / pull

Method pull

src/fl/remote/rpc/server.cpp.hpp:38–63  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

36}
37
38size_t Server::pull() {
39 if (!mRequestSource || !mRequestHandler) {
40 return 0;
41 }
42
43 size_t processed = 0;
44
45 // Pull JSON-RPC requests from source until none available
46 while (auto optRequest = mRequestSource()) {
47 fl::json request = fl::move(*optRequest);
48
49 // Process request through handler
50 fl::json response = mRequestHandler(request);
51
52 // Queue response (skip scheduled acknowledgments and async skip markers)
53 bool isScheduledAck = response.contains("scheduled") && response["scheduled"].as_bool().value_or(false);
54 bool isAsyncSkip = response.contains("__skip") && response["__skip"].as_bool().value_or(false);
55 if (!response.is_null() && !isScheduledAck && !isAsyncSkip) {
56 mOutgoingQueue.push_back(fl::move(response));
57 }
58
59 processed++;
60 }
61
62 return processed;
63}
64
65size_t Server::push() {
66 if (!mResponseSink) {

Callers 1

FL_TEST_FILEFunction · 0.80

Calls 5

value_orMethod · 0.80
containsMethod · 0.45
as_boolMethod · 0.45
is_nullMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected