Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1284)

Unified Diff: filter/txnBuf/ds.go

Issue 1309803004: Add transaction buffer filter. (Closed) Base URL: https://github.com/luci/gae.git@add_query_support
Patch Set: change pcg timeout and codereview server to crcr.as.com Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « filter/txnBuf/doc.go ('k') | filter/txnBuf/ds_txn.go » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: filter/txnBuf/ds.go
diff --git a/filter/txnBuf/ds.go b/filter/txnBuf/ds.go
new file mode 100644
index 0000000000000000000000000000000000000000..593211697c5c0b78e0ab112751b371e20f94a4e2
--- /dev/null
+++ b/filter/txnBuf/ds.go
@@ -0,0 +1,29 @@
+// 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 txnBuf
+
+import (
+ "golang.org/x/net/context"
+
+ ds "github.com/luci/gae/service/datastore"
+)
+
+type dsBuf struct {
+ ds.RawInterface
+
+ ns string
+}
+
+var _ ds.RawInterface = (*dsBuf)(nil)
+
+func (d *dsBuf) RunInTransaction(f func(context.Context) error, opts *ds.TransactionOptions) error {
+ return doRunInTransaction(d.RawInterface, f, opts)
+}
+
+func doRunInTransaction(base ds.RawInterface, f func(context.Context) error, opts *ds.TransactionOptions) error {
+ return base.RunInTransaction(func(ctx context.Context) error {
+ return withTxnBuf(ctx, f, opts)
+ }, opts)
+}
« no previous file with comments | « filter/txnBuf/doc.go ('k') | filter/txnBuf/ds_txn.go » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698