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

Method sendAsyncResponse

src/fl/remote/remote.cpp.hpp:34–56  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

32// Async Response Support
33
34void Remote::sendAsyncResponse(const char* method, const fl::json& result) {
35 fl::string methodName(method);
36 auto it = mAsyncRequests.find(methodName);
37 if (it == mAsyncRequests.end()) {
38 FL_WARN("No pending async request for method: " << method);
39 return;
40 }
41
42 int requestId = it->second.requestId;
43 mAsyncRequests.erase(it);
44
45 // Build JSON-RPC response
46 fl::json response = fl::json::object();
47 response.set("jsonrpc", "2.0");
48 response.set("id", requestId);
49 response.set("result", result);
50
51 // Send via response sink
52 if (mResponseSink) {
53 mResponseSink(response);
54 FL_DBG("Sent async response for " << method << " (id=" << requestId << ")");
55 }
56}
57
58void Remote::sendStreamUpdate(const char* method, const fl::json& update) {
59 fl::string methodName(method);

Callers 1

registerFunctionsMethod · 0.80

Calls 4

findMethod · 0.45
endMethod · 0.45
eraseMethod · 0.45
setMethod · 0.45

Tested by

no test coverage detected