sign

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrTimedOut = errors.New("timed out")

ErrTimedOut shows that the signal wasn't fired during the duration, given to the WaitTimeout.

Functions

This section is empty.

Types

type Sign

type Sign chan struct{}

Sign is a helper structure which holds a simple signal, for instance, if a goroutine is stopped.

func Signal

func Signal() Sign

Signal makes new instance of Sign.

func (Sign) Done

func (d Sign) Done()

Done signs that the sign is done.

func (Sign) Signaled

func (d Sign) Signaled() bool

Signaled immediately checks if the signal was already given.

func (Sign) WaitTimeout

func (d Sign) WaitTimeout(timeout time.Duration) error

WaitTimeout waits until the signal is fired or timed out.

Jump to

Keyboard shortcuts

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