Browse Source

concurrency: provide old STM functions as deprecated

semver
Anthony Romano 8 years ago
parent
commit
31d5d610fc
1 changed files with 15 additions and 0 deletions
  1. 15 0
      clientv3/concurrency/stm.go

+ 15 - 0
clientv3/concurrency/stm.go

@@ -369,3 +369,18 @@ func respToValue(resp *v3.GetResponse) string {
 	}
 	return string(resp.Kvs[0].Value)
 }
+
+// NewSTMRepeatable is deprecated.
+func NewSTMRepeatable(ctx context.Context, c *v3.Client, apply func(STM) error) (*v3.TxnResponse, error) {
+	return NewSTM(c, apply, WithAbortContext(ctx), WithIsolation(RepeatableReads))
+}
+
+// NewSTMSerializable is deprecated.
+func NewSTMSerializable(ctx context.Context, c *v3.Client, apply func(STM) error) (*v3.TxnResponse, error) {
+	return NewSTM(c, apply, WithAbortContext(ctx), WithIsolation(Serializable))
+}
+
+// NewSTMReadCommitted is deprecated.
+func NewSTMReadCommitted(ctx context.Context, c *v3.Client, apply func(STM) error) (*v3.TxnResponse, error) {
+	return NewSTM(c, apply, WithAbortContext(ctx), WithIsolation(ReadCommitted))
+}