run

package
v0.2.8 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2022 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckUntil added in v0.2.5

func CheckUntil(f func() bool, dur time.Duration, stopCh <-chan struct{}) bool

CheckUntil run f each dur, until f return true or stopCh return when stop because f return true, CheckUntil return true when stop because stopCh return, CheckUntil return false

func CheckUntilImmediately added in v0.2.5

func CheckUntilImmediately(f func() bool, dur time.Duration, stopCh <-chan struct{}) bool

CheckUntilImmediately is an immediately version of CheckUntil CheckUntilImmediatelylike EachUntilImmediately to EachUntil

func EachUntil

func EachUntil(f func(), dur time.Duration, stopCh <-chan struct{})

EachUntil run f each dur, until stopCh return

func EachUntilImmediately

func EachUntilImmediately(f func(), dur time.Duration, stopCh <-chan struct{})

EachUntilImmediately like EachUntil but run f once immediately, unless stopCh already return

Types

type LazyRunner added in v0.2.6

type LazyRunner struct {
	Run func(stopCh <-chan struct{})

	Locker interface {
		sync.Locker

		RLock()
		RUnlock()
	} // protect supervisorStopChs, running, stoppedCh
	// contains filtered or unexported fields
}

LazyRunner run Run only when there is at least one supervisor

func (*LazyRunner) AddSupervisor added in v0.2.6

func (lr *LazyRunner) AddSupervisor(stopCh <-chan struct{})

func (*LazyRunner) Wait added in v0.2.6

func (lr *LazyRunner) Wait()

Jump to

Keyboard shortcuts

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