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

Method store

valdi/src/valdi/runtime/JavaScript/Modules/PersistentStore.cpp:40–50  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

38PersistentStore::~PersistentStore() = default;
39
40void PersistentStore::store(const StringBox& key,
41 const BytesView& blob,
42 uint64_t ttlSeconds,
43 uint64_t weight,
44 Function<void(Result<Void>)> completion) {
45 _dispatchQueue->async(
46 [key, blob, ttlSeconds, weight, self = strongRef(this), completion = std::move(completion)]() {
47 self->_store.store(key, blob, ttlSeconds, weight);
48 self->scheduleSave(completion);
49 });
50}
51
52void PersistentStore::setMaxWeight(uint64_t maxWeight) {
53 _store.setMaxWeight(maxWeight);

Callers

nothing calls this directly

Calls 4

scheduleSaveMethod · 0.95
strongRefFunction · 0.85
storeMethod · 0.65
asyncMethod · 0.45

Tested by

no test coverage detected