MCPcopy Create free account
hub / github.com/apache/trafficserver / get

Method get

plugins/experimental/wasm/lib/src/shared_data.cc:44–57  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

42}
43
44WasmResult SharedData::get(std::string_view vm_id, const std::string_view key,
45 std::pair<std::string, uint32_t> *result) {
46 std::lock_guard<std::mutex> lock(mutex_);
47 auto map = data_.find(std::string(vm_id));
48 if (map == data_.end()) {
49 return WasmResult::NotFound;
50 }
51 auto it = map->second.find(std::string(key));
52 if (it != map->second.end()) {
53 *result = it->second;
54 return WasmResult::Ok;
55 }
56 return WasmResult::NotFound;
57}
58
59WasmResult SharedData::keys(std::string_view vm_id, std::vector<std::string> *result) {
60 result->clear();

Callers 12

startMethod · 0.45
schedule_handlerFunction · 0.45
http_event_handlerFunction · 0.45
global_hook_handlerFunction · 0.45
getSharedDataMethod · 0.45
initializeMethod · 0.45
getRootContextMethod · 0.45
startMethod · 0.45
copyToMethod · 0.45
getSharedDataMethod · 0.45
wasm_vmMethod · 0.45
vm_contextMethod · 0.45

Calls 3

stringClass · 0.85
findMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected