routine

package
v1.11.4 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2022 License: MPL-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager

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

func NewManager

func NewManager(logger hclog.Logger) *Manager

func (*Manager) IsRunning

func (m *Manager) IsRunning(name string) bool

func (*Manager) Start

func (m *Manager) Start(ctx context.Context, name string, routine Routine) error

func (*Manager) Stop

func (m *Manager) Stop(name string) <-chan struct{}

func (*Manager) StopAll

func (m *Manager) StopAll()

StopAll goroutines. Once StopAll is called, it is no longer safe to add no goroutines to the Manager.

func (*Manager) Wait added in v1.10.7

func (m *Manager) Wait()

Wait for all goroutines to stop after StopAll is called.

type Routine

type Routine func(ctx context.Context) error

Jump to

Keyboard shortcuts

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