forked from apache/incubator-seata-go
-
Notifications
You must be signed in to change notification settings - Fork 0
/
transaction_coordinator.go
35 lines (27 loc) · 1.11 KB
/
transaction_coordinator.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
package server
import (
"github.com/duolacloud/seata-golang/pkg/base/meta"
"github.com/duolacloud/seata-golang/pkg/client/rm"
"github.com/duolacloud/seata-golang/pkg/client/tm"
"github.com/duolacloud/seata-golang/pkg/tc/session"
)
type TransactionCoordinatorInbound interface {
tm.TransactionManager
rm.ResourceManagerOutbound
}
type TransactionCoordinatorOutbound interface {
// Commit a branch transaction.
branchCommit(globalSession *session.GlobalSession, branchSession *session.BranchSession) (meta.BranchStatus, error)
// Rollback a branch transaction.
branchRollback(globalSession *session.GlobalSession, branchSession *session.BranchSession) (meta.BranchStatus, error)
}
type TransactionCoordinator interface {
TransactionCoordinatorInbound
TransactionCoordinatorOutbound
// Do global commit.
doGlobalCommit(globalSession *session.GlobalSession, retrying bool) (bool, error)
// Do global rollback.
doGlobalRollback(globalSession *session.GlobalSession, retrying bool) (bool, error)
// Do global report.
doGlobalReport(globalSession *session.GlobalSession, xid string, param meta.GlobalStatus) error
}