timer

package
v0.0.0-...-6b053b6 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2018 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cron

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

Cron

func (*Cron) Stop

func (c *Cron) Stop()

type CronExpr

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

Field name | Mandatory? | Allowed values | Allowed special characters ---------- | ---------- | -------------- | -------------------------- Seconds | No | 0-59 | * / , - Minutes | Yes | 0-59 | * / , - Hours | Yes | 0-23 | * / , - Day of month | Yes | 1-31 | * / , - Month | Yes | 1-12 | * / , - Day of week | Yes | 0-6 | * / , -

func NewCronExpr

func NewCronExpr(expr string) (cronExpr *CronExpr, err error)

goroutine safe

func (*CronExpr) Next

func (e *CronExpr) Next(t time.Time) time.Time

goroutine safe

type Dispatcher

type Dispatcher struct {
	ChanTimer chan *Timer
}

one dispatcher per goroutine (goroutine not safe)

func NewDispatcher

func NewDispatcher(l int) *Dispatcher

func (*Dispatcher) AfterFunc

func (disp *Dispatcher) AfterFunc(d time.Duration, cb func()) *Timer

func (*Dispatcher) CronFunc

func (disp *Dispatcher) CronFunc(cronExpr *CronExpr, _cb func()) *Cron

type Timer

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

Timer

func (*Timer) Cb

func (t *Timer) Cb()

func (*Timer) Stop

func (t *Timer) Stop()

Jump to

Keyboard shortcuts

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