From 31d5d610fc48578275e4a62e0960fa3fb8f224cd Mon Sep 17 00:00:00 2001 From: Anthony Romano Date: Wed, 3 May 2017 02:07:01 -0700 Subject: [PATCH] concurrency: provide old STM functions as deprecated semver --- clientv3/concurrency/stm.go | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/clientv3/concurrency/stm.go b/clientv3/concurrency/stm.go index 7ab019e99..bba058665 100644 --- a/clientv3/concurrency/stm.go +++ b/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)) +}