timers

package
v1.22.0 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2020 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// EpochTimer is a type for HandlerInfo structure.
	EpochTimer = "EpochTimer"
	// AlphabetTimer is a type for HandlerInfo structure.
	AlphabetTimer = "AlphabetTimer"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type NewAlphabetEmitTick added in v0.12.0

type NewAlphabetEmitTick struct{}

NewAlphabetEmitTick is a event for gas emission from alphabet contract.

func (NewAlphabetEmitTick) MorphEvent added in v0.12.0

func (NewAlphabetEmitTick) MorphEvent()

MorphEvent implements Event interface.

type NewEpochTick

type NewEpochTick struct{}

NewEpochTick is a new epoch local ticker event.

func (NewEpochTick) MorphEvent

func (NewEpochTick) MorphEvent()

MorphEvent implements Event interface.

type Params

type Params struct {
	Log              *zap.Logger
	EpochDuration    time.Duration
	AlphabetDuration time.Duration
}

Params for timers instance constructor.

type Timers

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

Timers is a component for local inner ring timers to produce local events.

func New

func New(p *Params) *Timers

New creates instance of timers component.

func (*Timers) RegisterHandler

func (t *Timers) RegisterHandler(h event.HandlerInfo) error

RegisterHandler of local timers events.

func (*Timers) ResetEpochTimer

func (t *Timers) ResetEpochTimer()

ResetEpochTimer to start it again when event has been processed.

func (*Timers) Start

func (t *Timers) Start(ctx context.Context)

Start runs all available local timers.

Jump to

Keyboard shortcuts

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