manager

package
v1.20.3-test-rc2 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2024 License: Apache-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 GroupManager

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

func (*GroupManager) Add

func (g *GroupManager) Add(ctx context.Context, f func(context.Context))

func (*GroupManager) AddInformers

func (g *GroupManager) AddInformers(ctx context.Context, informers map[string]k8sCache.SharedIndexInformer)

func (*GroupManager) Wait

func (g *GroupManager) Wait()

func (*GroupManager) WaitWithTimeout

func (g *GroupManager) WaitWithTimeout(timeout time.Duration) error

type Interface

type Interface interface {
	// Add will start a go routine for the given "function" and adds it to the list of go routines
	// and will also remove the "function" from the list when it completes
	Add(ctx context.Context, function func(context.Context))

	AddInformers(ctx context.Context, informers map[string]k8sCache.SharedIndexInformer)

	// Wait blocks the execution of the process until all the go routines in the manager are completed.
	Wait()

	// WaitWithTimeout blocks the execution of the process until timeout or till all all the go routines in the manager are completed
	WaitWithTimeout(timeout time.Duration) error
}

Interface keeps track of the go routines in the system and can be used to gracefully shutdown the the system by waiting for completion of go routines added to it.

func New

func New() Interface

Jump to

Keyboard shortcuts

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