Documentation ¶
Overview ¶
config
transcommskeleton
distributed transcation coordinater
transctx
transhandler
transnode
transtype
Index ¶
- Constants
- Variables
- func ProcessTransCmd(tid TransNodeID, cmd TransCmd) bool
- func ProcessTransResult(tid, childtid TransNodeID, retCode int, ud interface{}) bool
- func ProcessTransStart(parentTnp, myTnp *TransNodeParam, ud interface{}, timeout time.Duration) bool
- func RegisteHandler(tt TransType, th TransHandler)
- func RegisteTxCommSkeleton(name string, tcs TransactCommSkeleton)
- func SendTranscatResume(tnode *TransNode) bool
- func SendTranscatYield(tnode *TransNode) bool
- func Stats() map[int]TransStats
- type Configuration
- type OnChildRespWrapper
- type OnCommitWrapper
- type OnExecuteWrapper
- type OnRollBackWrapper
- type TransBrotherNotify
- type TransCallback
- type TransCmd
- type TransCtx
- type TransExeResult
- type TransHanderWrapper
- func (wrapper *TransHanderWrapper) OnChildTransRep(n *TransNode, hChild TransNodeID, retCode int, ud interface{}) TransExeResult
- func (wrapper *TransHanderWrapper) OnCommit(n *TransNode) TransExeResult
- func (wrapper *TransHanderWrapper) OnExcute(n *TransNode, ud interface{}) TransExeResult
- func (wrapper *TransHanderWrapper) OnRollBack(n *TransNode) TransExeResult
- type TransHandler
- type TransNode
- func (this *TransNode) GetChildTransParam(childid TransNodeID) *TransNodeParam
- func (this *TransNode) Go(obj *basic.Object) TransExeResult
- func (this *TransNode) MakeBrotherWith(brother *TransNode, tbn TransBrotherNotify)
- func (this *TransNode) Resume() TransExeResult
- func (this *TransNode) StartChildTrans(tnp *TransNodeParam, ud interface{}, timeout time.Duration) TransExeResult
- func (this *TransNode) Yield() TransExeResult
- type TransNodeID
- type TransNodeParam
- type TransOwnerType
- type TransResult
- type TransStats
- type TransType
- type TransactCommSkeleton
- type TransactCommitPolicy
Constants ¶
View Source
const ( ///transact execute result TransResult_Success int = iota TransResult_Failed TransResult_TimeOut TransResult_Max )
View Source
const ( ///transact TransRootNodeLevel int = 0 DefaultTransactTimeout time.Duration = 30 * time.Second )
View Source
const ( TransStatsOp_Exe = iota TransStatsOp_Rollback TransStatsOp_Commit TransStatsOp_Yiled TransStatsOp_Resume TransStatsOp_Timeout )
Variables ¶
View Source
var Config = Configuration{}
View Source
var (
DTCModule = &transactCoordinater{transPool: make(map[TransNodeID]*TransNode)}
)
View Source
var (
TransNodeIDNil = TransNodeID(0)
)
Functions ¶
func ProcessTransCmd ¶
func ProcessTransCmd(tid TransNodeID, cmd TransCmd) bool
func ProcessTransResult ¶
func ProcessTransResult(tid, childtid TransNodeID, retCode int, ud interface{}) bool
func ProcessTransStart ¶
func ProcessTransStart(parentTnp, myTnp *TransNodeParam, ud interface{}, timeout time.Duration) bool
func RegisteHandler ¶
func RegisteHandler(tt TransType, th TransHandler)
func RegisteTxCommSkeleton ¶
func RegisteTxCommSkeleton(name string, tcs TransactCommSkeleton)
func SendTranscatResume ¶
func SendTranscatYield ¶
func Stats ¶
func Stats() map[int]TransStats
Types ¶
type Configuration ¶
type Configuration struct { TxSkeletonName string // contains filtered or unexported fields }
func (*Configuration) Close ¶
func (this *Configuration) Close() error
func (*Configuration) Init ¶
func (this *Configuration) Init() error
func (*Configuration) Name ¶
func (this *Configuration) Name() string
type OnChildRespWrapper ¶
type OnChildRespWrapper func(n *TransNode, hChild TransNodeID, retCode int, ud interface{}) TransExeResult
type OnCommitWrapper ¶
type OnCommitWrapper func(n *TransNode) TransExeResult
type OnExecuteWrapper ¶
type OnExecuteWrapper func(n *TransNode, ud interface{}) TransExeResult
type OnRollBackWrapper ¶
type OnRollBackWrapper func(n *TransNode) TransExeResult
type TransBrotherNotify ¶
type TransBrotherNotify func(*TransNode, TransExeResult)
type TransCallback ¶
type TransCallback func(*TransNode)
type TransCtx ¶
type TransCtx struct {
// contains filtered or unexported fields
}
func NewTransCtx ¶
func NewTransCtx() *TransCtx
type TransExeResult ¶
type TransExeResult int
const ( ///transact result TransExeResult_Success TransExeResult = iota TransExeResult_Failed TransExeResult_Yield TransExeResult_NullPointer TransExeResult_NoStart TransExeResult_NoSetHandler TransExeResult_ChildNodeNotExist TransExeResult_ChildNodeRepeateRet TransExeResult_AsynFailed TransExeResult_HadDone TransExeResult_StartChildFailed TransExeResult_UnsafeExecuteEnv )
type TransHanderWrapper ¶
type TransHanderWrapper struct { OnExecuteWrapper OnCommitWrapper OnRollBackWrapper OnChildRespWrapper }
func (*TransHanderWrapper) OnChildTransRep ¶
func (wrapper *TransHanderWrapper) OnChildTransRep(n *TransNode, hChild TransNodeID, retCode int, ud interface{}) TransExeResult
func (*TransHanderWrapper) OnCommit ¶
func (wrapper *TransHanderWrapper) OnCommit(n *TransNode) TransExeResult
func (*TransHanderWrapper) OnExcute ¶
func (wrapper *TransHanderWrapper) OnExcute(n *TransNode, ud interface{}) TransExeResult
func (*TransHanderWrapper) OnRollBack ¶
func (wrapper *TransHanderWrapper) OnRollBack(n *TransNode) TransExeResult
type TransHandler ¶
type TransHandler interface { OnExcute(n *TransNode, ud interface{}) TransExeResult OnCommit(n *TransNode) TransExeResult OnRollBack(n *TransNode) TransExeResult OnChildTransRep(n *TransNode, hChild TransNodeID, retCode int, ud interface{}) TransExeResult }
func GetHandler ¶
func GetHandler(tt TransType) TransHandler
type TransNode ¶
type TransNode struct { TransEnv *TransCtx TransRep *TransResult MyTnp *TransNodeParam ParentTnp *TransNodeParam Childs map[TransNodeID]*TransNodeParam AsynCallback TransCallback // contains filtered or unexported fields }
func (*TransNode) GetChildTransParam ¶
func (this *TransNode) GetChildTransParam(childid TransNodeID) *TransNodeParam
func (*TransNode) MakeBrotherWith ¶
func (this *TransNode) MakeBrotherWith(brother *TransNode, tbn TransBrotherNotify)
func (*TransNode) Resume ¶
func (this *TransNode) Resume() TransExeResult
func (*TransNode) StartChildTrans ¶
func (this *TransNode) StartChildTrans(tnp *TransNodeParam, ud interface{}, timeout time.Duration) TransExeResult
func (*TransNode) Yield ¶
func (this *TransNode) Yield() TransExeResult
type TransNodeID ¶
type TransNodeID int64
type TransNodeParam ¶
type TransNodeParam struct { TId TransNodeID Tt TransType Ot TransOwnerType Tct TransactCommitPolicy Oid int SkeletonID int LevelNo int AreaID int TimeOut time.Duration }
type TransOwnerType ¶
type TransOwnerType int
const ( ///transact owner type TransOwnerType_Invalid TransOwnerType = iota TransOwnerType_Max )
type TransResult ¶
type TransResult struct { RetCode int RetFiels interface{} }
type TransStats ¶
type TransactCommSkeleton ¶
type TransactCommSkeleton interface { SendTransResult(parent, me *TransNodeParam, tr *TransResult) bool SendTransStart(parent, me *TransNodeParam, ud interface{}) bool SendCmdToTransNode(tnp *TransNodeParam, cmd TransCmd) bool GetSkeletonID() int GetAreaID() int }
func GetTxCommSkeleton ¶
func GetTxCommSkeleton(name string) TransactCommSkeleton
type TransactCommitPolicy ¶
type TransactCommitPolicy int
const ( TransactCommitPolicy_SelfDecide TransactCommitPolicy = iota TransactCommitPolicy_TwoPhase )
Click to show internal directories.
Click to hide internal directories.