work

package
v1.3.3 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2019 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

@Time : 2019-12-09 09:20 @Author : zr

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type IntervalWork

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

IntervalWork 间隔时间任务

func RegisterNewWork

func RegisterNewWork(intervalTime time.Duration, workHandler func(), onError OnError) *IntervalWork

func (*IntervalWork) Join

func (i *IntervalWork) Join()

func (*IntervalWork) Run

func (i *IntervalWork) Run()

func (*IntervalWork) Stop

func (i *IntervalWork) Stop()

type OnError

type OnError func(err error)

type ScheduleDayWork

type ScheduleDayWork struct {
	ScheduleTime time.Time
	// contains filtered or unexported fields
}

ScheduleWork 每日固定时间任务

func RegisterScheduleDayWork

func RegisterScheduleDayWork(schedule time.Time, workHandler func(), onError OnError) *ScheduleDayWork

func (*ScheduleDayWork) Join

func (s *ScheduleDayWork) Join()

func (*ScheduleDayWork) Run

func (s *ScheduleDayWork) Run()

func (*ScheduleDayWork) Stop

func (s *ScheduleDayWork) Stop()

type Work

type Work interface {
	Run()
	Stop()
	Join()
}

Jump to

Keyboard shortcuts

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