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

Method resolveRpc

src/fl/net/http/stream_transport.cpp.hpp:129–156  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

127}
128
129bool HttpStreamTransport::resolveRpc(const fl::json& msg, const fl::string& idKey) {
130 auto it = mPendingCalls.find(idKey);
131 if (it == mPendingCalls.end()) {
132 return false;
133 }
134 PendingCall* pending = &it->second;
135
136 // Check for error
137 if (msg.contains("error")) {
138 fl::task::Error err(msg["error"]["message"].as_string().value());
139 pending->promise.complete_with_error(err);
140 mPendingCalls.erase(idKey);
141 return true;
142 }
143
144 // Check for ACK (ASYNC mode sends acknowledged first)
145 if (msg.contains("result") && msg["result"].contains("acknowledged")) {
146 if (msg["result"]["acknowledged"].as_bool() == true) {
147 pending->ackReceived = true;
148 return true; // Stay pending, wait for final result
149 }
150 }
151
152 // Final result
153 pending->promise.complete_with_value(msg);
154 mPendingCalls.erase(idKey);
155 return true;
156}
157
158bool HttpStreamTransport::resolveRpcStream(const fl::json& msg, const fl::string& idKey) {
159 auto it = mPendingStreams.find(idKey);

Callers

nothing calls this directly

Calls 9

complete_with_errorMethod · 0.80
complete_with_valueMethod · 0.80
findMethod · 0.45
endMethod · 0.45
containsMethod · 0.45
valueMethod · 0.45
as_stringMethod · 0.45
eraseMethod · 0.45
as_boolMethod · 0.45

Tested by

no test coverage detected