runnable

package
v0.0.0-...-c510420 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2022 License: MIT Imports: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Graceful

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

Graceful implements the Runnable interface and handles graceful shutdown of the component. This is useful for components that don't stop immediately.

func NewGraceful

func NewGraceful(run RunCall, stop StopCall, requireLeaderElection bool, wg *sync.WaitGroup, logger logr.Logger) *Graceful

NewGraceful creates a new graceful shutdown runnable. logger is optional. Pass nil for the default logger.

func (*Graceful) NeedLeaderElection

func (g *Graceful) NeedLeaderElection() bool

NeedLeaderElection implements the LeaderElectionRunnable interface, which helps the controller manager decide when to start the component.

func (*Graceful) Start

func (g *Graceful) Start(ctx context.Context) error

Start implements the Runnable interface which enables the component to be managed by the controller manager.

type RunCall

type RunCall func(context.Context) error

RunCall starts a component.

type StopCall

type StopCall func() error

StopCall stops a component.

Jump to

Keyboard shortcuts

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