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

Method sendFinal

src/fl/remote/rpc/response_send.h:114–132  ·  view source on GitHub ↗

* @brief Send final response and mark stream as complete (for ASYNC_STREAM mode) * @param result The final result payload (any JSON value) * * Creates a JSON-RPC response with "stop" marker: * {"jsonrpc": "2.0", "result": {"value": , "stop": true}, "id": } * * After calling sendFinal(), no more responses can be sent. */

Source from the content-addressed store, hash-verified

112 * After calling sendFinal(), no more responses can be sent.
113 */
114 void sendFinal(const fl::json& result) {
115 if (!mResponseSink || mIsFinal) {
116 return;
117 }
118
119 mIsFinal = true;
120
121 fl::json response = fl::json::object();
122 response.set("jsonrpc", "2.0");
123
124 fl::json finalResult = fl::json::object();
125 finalResult.set("value", result);
126 finalResult.set("stop", true);
127
128 response.set("result", finalResult);
129 response.set("id", mRequestId);
130
131 mResponseSink(response);
132 }
133
134 /**
135 * @brief Check if final response has been sent

Callers 3

FL_TEST_FILEFunction · 0.80
response_send.hppFile · 0.80
FL_TEST_FILEFunction · 0.80

Calls 1

setMethod · 0.45

Tested by

no test coverage detected