timer

package
v0.0.0-...-5e2b60c Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2017 License: BSD-3-Clause Imports: 5 Imported by: 0

Documentation

Overview

timer privide a interface to use timer

Index

Constants

This section is empty.

Variables

View Source
var (
	TimerTypeError = errors.New("unsupported Timer type")
)

define errors

Functions

This section is empty.

Types

type Jober

type Jober interface {
	Run() error
	Stop() error
}

caller implement this interface

type Timer

type Timer interface {
	Add(j Jober, period uint32, onetime bool) (jid uint32, err error)
	Remove(jid uint32) error
	Modify(jid, period uint32, onetime bool) error
	Start() error
}

func NewTimer

func NewTimer(tt TimerType) (t Timer, err error)

type TimerType

type TimerType string
const (
	TIMEWHEEL TimerType = "timewheel"
)

define timer type

Jump to

Keyboard shortcuts

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