MCPcopy Create free account
hub / github.com/Snapchat/Valdi / complete

Method complete

valdi/test/utils/RequestManagerMock.cpp:21–34  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

19 : _request(std::move(request)), _completion(std::move(completion)) {}
20
21 void complete(const Result<snap::valdi_core::HTTPResponse>& result) {
22 std::lock_guard<std::mutex> guard(_mutex);
23 auto completion = std::move(_completion);
24 if (completion == nullptr) {
25 return;
26 }
27 _response = {result};
28
29 if (result.success()) {
30 completion->onComplete(result.value());
31 } else {
32 completion->onFail(result.error().toString());
33 }
34 }
35
36 void cancel() override {
37 std::lock_guard<std::mutex> guard(_mutex);

Callers 1

performRequestMethod · 0.45

Calls 6

onCompleteMethod · 0.65
valueMethod · 0.65
onFailMethod · 0.65
toStringMethod · 0.65
errorMethod · 0.65
successMethod · 0.45

Tested by

no test coverage detected