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: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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