I would like to have concurrent read / write for multiple KV keys. I can’t seem to find it online. Can anyone please provide the examples for it? Thanks.
Basically if I need to wait for the read, it needs around 10ms for each read, which is kind of slow. How do I perform concurrent reads?
I tried doing this, but accessing from workers is strangely synchronous. The duration of the code snippet below increases linearly with the number of items in keys
let keys = [key1, key2, ... ]
let kvValues = [];
for (const key of keys) {
var val = KV.get(key);
kvValues.push(val);
}
kvValues = await Promise.all(kvValues);
Do you know if an asynchronous way to read multiple keys is available? If so, could you please point me the right way? I searched as much as I could online, but couldn’t find anything.