Commit d12b9bd1 authored by Kirill Smelkov's avatar Kirill Smelkov

.

parent dc78282e
...@@ -177,6 +177,7 @@ type Transaction interface { ...@@ -177,6 +177,7 @@ type Transaction interface {
// New creates new transaction. // New creates new transaction.
// //
// XXX the transaction will be associated with ctx (txnCtx derives from ctx + associates txn) // XXX the transaction will be associated with ctx (txnCtx derives from ctx + associates txn)
// XXX nested transactions are not supported.
func New(ctx context.Context) (txn Transaction, txnCtx context.Context) { func New(ctx context.Context) (txn Transaction, txnCtx context.Context) {
return newTxn(ctx) return newTxn(ctx)
} }
......
...@@ -64,26 +64,29 @@ func newTxn(ctx context.Context) (Transaction, context.Context) { ...@@ -64,26 +64,29 @@ func newTxn(ctx context.Context) (Transaction, context.Context) {
return txn, txnCtx return txn, txnCtx
} }
// Status implements Transaction.
func (txn *transaction) Status() Status { func (txn *transaction) Status() Status {
txn.mu.Lock() txn.mu.Lock()
defer txn.mu.Unlock() defer txn.mu.Unlock()
return txn.status return txn.status
} }
// Commit implements Transaction.
func (txn *transaction) Commit(ctx context.Context) error { func (txn *transaction) Commit(ctx context.Context) error {
panic("TODO") panic("TODO")
} }
// Abort implements Transaction.
func (txn *transaction) Abort() { func (txn *transaction) Abort() {
panic("TODO") panic("TODO")
} }
// Join implements Transaction.
func (txn *transaction) Join(dm DataManager) { func (txn *transaction) Join(dm DataManager) {
panic("TODO") panic("TODO")
} }
// RegisterSync implements Transaction.
func (txn *transaction) RegisterSync(sync Synchronizer) { func (txn *transaction) RegisterSync(sync Synchronizer) {
panic("TODO") panic("TODO")
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment