runner

package
v0.14.0-patch-req-pend... Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2021 License: AGPL-3.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SingleRunner

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

SingleRunner is a support struct for implementing module.ReadyDoneAware

func NewSingleRunner

func NewSingleRunner() SingleRunner

func (*SingleRunner) Abort

func (s *SingleRunner) Abort() <-chan struct{}

Abort() will abort the SingleRunner. Note that the channel returned from Start() will never be closed if the SingleRunner is aborted before Start() is called. This mimics the real world case:

  • consider a runner at a starting position of a race waiting for the start signal
  • if the runner to told to abort the race _before_ the start signal occurred, the runner will never start

func (*SingleRunner) ShutdownSignal

func (u *SingleRunner) ShutdownSignal() <-chan struct{}

ShutdownSignal returns a channel that is closed when the shutdown signal has been given

func (*SingleRunner) Start

func (s *SingleRunner) Start(f func()) <-chan struct{}

Jump to

Keyboard shortcuts

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