clair: github.com/coreos/clair/pkg/stopper Index | Files

package stopper

import "github.com/coreos/clair/pkg/stopper"

Index

Package Files

stopper.go

type Stopper Uses

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

Stopper eases the graceful termination of a group of goroutines

func NewStopper Uses

func NewStopper() *Stopper

NewStopper initializes a new Stopper instance

func (*Stopper) Begin Uses

func (s *Stopper) Begin()

Begin indicates that a new goroutine has started.

func (*Stopper) Chan Uses

func (s *Stopper) Chan() chan struct{}

Chan returns the channel on which goroutines could listen to determine if they should stop. The channel is closed when Stop() is called.

func (*Stopper) End Uses

func (s *Stopper) End()

End indicates that a goroutine has stopped.

func (*Stopper) Sleep Uses

func (s *Stopper) Sleep(d time.Duration) bool

Sleep puts the current goroutine on sleep during a duration d Sleep could be interrupted in the case the goroutine should stop itself, in which case Sleep returns false.

func (*Stopper) Stop Uses

func (s *Stopper) Stop()

Stop asks every goroutine to end.

Package stopper imports 2 packages (graph) and is imported by 23 packages. Updated 2017-02-09. Refresh now. Tools for package owners.