twopc

package
v0.0.0-...-97b9ebb Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 25, 2022 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package twopc implements transaction commit using 2-phase commit protocol

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ErrVoteConflict

type ErrVoteConflict struct {
	Node  tcommit.NodeID
	Votes []tcommit.Vote
}

ErrVoteConflict shows an error on voting where TM receives invalid votes from resource managers

func (*ErrVoteConflict) Error

func (err *ErrVoteConflict) Error() string

type TmNode

type TmNode struct {
	// contains filtered or unexported fields
}

TmNode implements transaction manager node instance for fixed set of resource managers

func NewManager

func NewManager(rms map[tcommit.NodeID]tcommit.Resource) *TmNode

NewManager node for resource managers

func (*TmNode) Begin

func (tm *TmNode) Begin(ctx context.Context, votes tcommit.Votes,
	meta tcommit.Meta) error

Begin transaction, see tcommit.Manager intercace

func (*TmNode) Finish

func (tm *TmNode) Finish(ctx context.Context, node tcommit.NodeID,
	meta tcommit.Meta) error

Finish transaction, see tcommit.Manager intercace

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL