Index: filter/dscache/ds_txn.go |
diff --git a/filter/dscache/ds_txn.go b/filter/dscache/ds_txn.go |
new file mode 100644 |
index 0000000000000000000000000000000000000000..44142be0f4bf26023150632db43057047365178d |
--- /dev/null |
+++ b/filter/dscache/ds_txn.go |
@@ -0,0 +1,32 @@ |
+// Copyright 2015 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+package dscache |
+ |
+import ( |
+ ds "github.com/luci/gae/service/datastore" |
+) |
+ |
+type dsTxnCache struct { |
+ ds.RawInterface |
+ |
+ state *dsTxnState |
+ |
+ sc *supportContext |
Vadim Sh.
2015/08/06 01:23:33
so what happens with Gets in transaction? I'm lost
iannucci
2015/08/06 02:37:33
documented, but all methods that aren't DeleteMult
|
+} |
+ |
+var _ ds.RawInterface = (*dsTxnCache)(nil) |
+ |
+func (d *dsTxnCache) DeleteMulti(keys []ds.Key, cb ds.DeleteMultiCB) error { |
+ d.state.Add(d.sc, keys) |
+ return d.RawInterface.DeleteMulti(keys, cb) |
+} |
+ |
+func (d *dsTxnCache) PutMulti(keys []ds.Key, metas []ds.PropertyMap, cb ds.PutMultiCB) error { |
+ d.state.Add(d.sc, keys) |
+ return d.RawInterface.PutMulti(keys, metas, cb) |
+} |
+ |
+// TODO(riannucci): on GetAll, Load from memcache and invalidate entries if the |
+// memcache version doesn't match the datastore version. |