aboutsummaryrefslogtreecommitdiffstats
path: root/prototypes/connections/examples/storage.pure
blob: ff54ea335b66cd67cc740dae55f0dfaa7c1eeb9a (plain)
1
2
3
4
5
6
7
8
9
10
11
// The host supplies request bytes, an object name, and the expected revision.
// Failed storage results propagate to the host's response without executing reply.
on get {
    let object = store.read(request.key);
    reply(object, object.body);
}

on put {
    let saved = store.write(request.key, request.revision, request.body);
    reply(saved);
}