timer

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type KernMethod

type KernMethod struct {
	BcName string
}

func NewKernContractMethod

func NewKernContractMethod(bcName string) *KernMethod

func (*KernMethod) Add

func (*KernMethod) Do

func (*KernMethod) Trigger

func (t *KernMethod) Trigger(ctx contract.KContext, triggerBuf []byte)

type LedgerRely

type LedgerRely interface {
	// 获取状态机最新确认快照
	GetTipXMSnapshotReader() (ledger.XMSnapshotReader, error)
}

type Manager

type Manager struct {
	Ctx *TimerCtx
}

Manager manages all timer releated data, providing read/write interface

func (*Manager) GetObjectBySnapshot

func (mgr *Manager) GetObjectBySnapshot(bucket string, object []byte) ([]byte, error)

func (*Manager) GetTimerTasks

func (mgr *Manager) GetTimerTasks(blockHeight int64) (uint64, error)

GetTimerTasks get timer tasks

type TimerCtx

type TimerCtx struct {
	// 基础上下文
	xcontext.BaseCtx
	BcName   string
	Ledger   LedgerRely
	Contract contract.Manager
}

func NewTimerTaskCtx

func NewTimerTaskCtx(bcName string, leg LedgerRely, contract contract.Manager) (*TimerCtx, error)

type TimerManager

type TimerManager interface {
	GetTimerTasks(blockHeight int64) (uint64, error)
}

func NewTimerTaskManager

func NewTimerTaskManager(ctx *TimerCtx) (TimerManager, error)

NewTimerTaskManager create instance of TimerManager

Jump to

Keyboard shortcuts

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