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

Method sendStreamFinal

src/fl/remote/remote.cpp.hpp:85–111  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

83}
84
85void Remote::sendStreamFinal(const char* method, const fl::json& result) {
86 fl::string methodName(method);
87 auto it = mAsyncRequests.find(methodName);
88 if (it == mAsyncRequests.end()) {
89 FL_WARN("No pending async request for method: " << method);
90 return;
91 }
92
93 int requestId = it->second.requestId;
94 mAsyncRequests.erase(it); // Stream complete - remove request
95
96 // Build JSON-RPC response with "stop" marker
97 fl::json response = fl::json::object();
98 response.set("jsonrpc", "2.0");
99 response.set("id", requestId);
100
101 fl::json resultObj = fl::json::object();
102 resultObj.set("value", result);
103 resultObj.set("stop", true);
104 response.set("result", resultObj);
105
106 // Send via response sink
107 if (mResponseSink) {
108 mResponseSink(response);
109 FL_DBG("Sent stream final for " << method << " (id=" << requestId << ")");
110 }
111}
112
113// Error Reporting
114

Callers

nothing calls this directly

Calls 4

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

Tested by

no test coverage detected