redo

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: May 22, 2019 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CombiRecipt

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

func NewCombiRecipt

func NewCombiRecipt(list ...*Recipet) *CombiRecipt

func (*CombiRecipt) Stop

func (cr *CombiRecipt) Stop() bool

func (*CombiRecipt) Wait

func (cr *CombiRecipt) Wait() StopType

func (*CombiRecipt) WaitChan

func (cr *CombiRecipt) WaitChan() <-chan struct{}

type Job

type Job func(*RedoCtx)

func WrapFunc

func WrapFunc(work func()) Job

type JobState

type JobState int
const (
	JobRunning JobState = iota
	JobStopping
)

type Recipet

type Recipet struct {
	*sync.Mutex
	// contains filtered or unexported fields
}

func Perform

func Perform(once Job, duration time.Duration) *Recipet

perform job without gracefull exit

func PerformSafe

func PerformSafe(once Job, duration time.Duration) *Recipet

perform job with gracefull exit

func (*Recipet) Concat

func (m *Recipet) Concat(others ...*Recipet) *CombiRecipt

func (*Recipet) Stop

func (m *Recipet) Stop() bool

func (*Recipet) Wait

func (m *Recipet) Wait() StopType

func (*Recipet) WaitChan

func (m *Recipet) WaitChan() <-chan struct{}

type RedoCtx

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

func (*RedoCtx) SetDelayBeforeNext

func (ctx *RedoCtx) SetDelayBeforeNext(new_duration time.Duration)

func (*RedoCtx) StartNextRightNow

func (ctx *RedoCtx) StartNextRightNow()

func (*RedoCtx) StopRedo

func (ctx *RedoCtx) StopRedo()

type StopType

type StopType string
const (
	STOP_SYS  StopType = "SYS"
	STOP_USER          = "USER"
)

Jump to

Keyboard shortcuts

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