api.fabaccess-api/cache.capnp
Nadja von Reitzenstein Čerpnjak f7cb8a7d81 Update API a bit
2024-03-01 15:39:30 +01:00

18 lines
486 B
Cap'n Proto

@0xf6520578f143b471;
using import "utils.capnp".UUID;
struct Cache(Value) {
id @0 :UUID;
key @1 :Data;
value @2 :Cacheable(Value);
}
interface Cacheable(Value) {
get @0 () -> (key :Data, value :Value);
# Access the cached value. This returns both the value and the associated
# key. A consumer MUST use the Key returned here instead of the one stored
# in `Cache`, as it might have changed between being sent the `Cache`
# struct and calling `get`.
}