work

package
v1.4.12 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2020 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, loopFunc LoopFunc, onError OnError) *IntervalWork

func (*IntervalWork) Join

func (w *IntervalWork) Join()

func (*IntervalWork) Run

func (i *IntervalWork) Run()

func (*IntervalWork) Stop

func (w *IntervalWork) Stop()

type LoopFunc added in v1.3.6

type LoopFunc func(ctx context.Context) (err error)

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, loopFunc LoopFunc, onError OnError) *ScheduleDayWork

func (*ScheduleDayWork) Join

func (w *ScheduleDayWork) Join()

func (*ScheduleDayWork) Run

func (s *ScheduleDayWork) Run()

func (*ScheduleDayWork) Stop

func (w *ScheduleDayWork) Stop()

type Work

type Work interface {
	Run()
	Stop()
	Join()
	// contains filtered or unexported methods
}

Jump to

Keyboard shortcuts

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