signal

package
v2.17.1+incompatible Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2017 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ErrorOrFinish1

func ErrorOrFinish1(ctx context.Context, c <-chan error) error

func ErrorOrFinish2

func ErrorOrFinish2(ctx context.Context, c1, c2 <-chan error) error

func ExecuteAsync

func ExecuteAsync(f func() error) <-chan error

Types

type ActivityTimer

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

func CancelAfterInactivity

func CancelAfterInactivity(ctx context.Context, cancel context.CancelFunc, timeout time.Duration) *ActivityTimer

func (*ActivityTimer) UpdateActivity

func (t *ActivityTimer) UpdateActivity()

type CancelSignal

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

CancelSignal is a signal passed to goroutine, in order to cancel the goroutine on demand.

func NewCloseSignal

func NewCloseSignal() *CancelSignal

NewCloseSignal creates a new CancelSignal.

func (*CancelSignal) Cancel

func (v *CancelSignal) Cancel()

Cancel signals the goroutine to stop.

func (*CancelSignal) Cancelled

func (v *CancelSignal) Cancelled() bool

func (*CancelSignal) FinishThread

func (v *CancelSignal) FinishThread()

FinishThread signals that current goroutine has finished.

func (*CancelSignal) WaitForCancel

func (v *CancelSignal) WaitForCancel() <-chan struct{}

WaitForCancel should be monitored by the goroutine for when to stop.

func (*CancelSignal) WaitForDone

func (v *CancelSignal) WaitForDone()

WaitForDone is used by caller to wait for the goroutine finishes.

func (*CancelSignal) WaitThread

func (v *CancelSignal) WaitThread()

type Once added in v1.17.1

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

func (*Once) Do added in v1.17.1

func (o *Once) Do(f func())

func (*Once) Reset added in v1.17.1

func (o *Once) Reset()

Jump to

Keyboard shortcuts

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