engine

package
v0.0.0-...-17003a6 Latest Latest
Warning

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

Go to latest
Published: Feb 22, 2022 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseEngineConfig

type BaseEngineConfig struct {
	// Type engine type.
	Type string `mapstructure:"type"`
	// Rate engine call Callback rate.
	Rate int64 `mapstructure:"rate"`
	// Duration engine run duration.
	Duration time.Duration `mapstructure:"duration"`
	// Wg Semaphore of localWorker
	Wg *sync.WaitGroup
}

BaseEngineConfig base engine config.

type Callback

type Callback func()

Callback will be call in engine run.

type ConstantEngine

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

ConstantEngine is control rate by constant.

func (ConstantEngine) Close

func (b ConstantEngine) Close()

Close close the engine.

func (ConstantEngine) Run

func (b ConstantEngine) Run(callback Callback)

Run start the engine.

type Engine

type Engine interface {
	// Run start the engine.
	Run(callback Callback)
	// Close close the engine.
	Close()
}

Engine is used to control the rate for send tx.

func NewEngine

func NewEngine(baseEngineConf BaseEngineConfig) (e Engine)

NewEngine use given baseEngineConf create Engine.

Jump to

Keyboard shortcuts

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