Documentation
¶
Index ¶
- Variables
- type BranchExecutor
- type BranchFunc
- type DurationTimer
- type RunTimer
- type TC
- func (t *TC) Abort(ctx context.Context, gid string) error
- func (t *TC) Prepare(ctx context.Context, gt *transaction.GlobalTransaction) error
- func (t *TC) RegisterBranch(bt *transaction.BranchTransaction) error
- func (t *TC) RegisterBranchExecutor(transType string, executor BranchExecutor)
- func (t *TC) Submit(ctx context.Context, gid string) error
- type TimerFunc
Constants ¶
This section is empty.
Variables ¶
View Source
var (
InvalidStatus = errors.New("invalid status")
)
Functions ¶
This section is empty.
Types ¶
type BranchExecutor ¶
type BranchExecutor interface {
Exec(ctx context.Context, status transaction.Status, branch *transaction.BranchTransaction) error
}
type BranchFunc ¶
type BranchFunc func(ctx context.Context, status transaction.Status, branch *transaction.BranchTransaction) error
func (BranchFunc) Exec ¶
func (f BranchFunc) Exec(ctx context.Context, status transaction.Status, branch *transaction.BranchTransaction) error
type DurationTimer ¶
type DurationTimer struct {
// contains filtered or unexported fields
}
func NewDurationTimer ¶
func NewDurationTimer(d time.Duration) *DurationTimer
func (*DurationTimer) NextRunTime ¶
func (d *DurationTimer) NextRunTime(t time.Time) int64
type TC ¶
type TC struct {
RunTimer RunTimer
Store store.Store
BE map[string]BranchExecutor
// contains filtered or unexported fields
}
TC 全局事务协调者 处理事务状态转换
func (*TC) Prepare ¶
func (t *TC) Prepare(ctx context.Context, gt *transaction.GlobalTransaction) error
Prepare 协调者收到prepare请求处理
func (*TC) RegisterBranch ¶
func (t *TC) RegisterBranch(bt *transaction.BranchTransaction) error
func (*TC) RegisterBranchExecutor ¶
func (t *TC) RegisterBranchExecutor(transType string, executor BranchExecutor)
Click to show internal directories.
Click to hide internal directories.