channel

package
v0.0.0-...-ff439f2 Latest Latest
Warning

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

Go to latest
Published: Aug 8, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Timeout

func Timeout(d time.Duration) <-chan struct{}

Timeout returns a receive-only channel that will be closed after the specified Duration. The value of a structure like this over a direct call to time.Sleep is that a channel can participate in a select

Types

type ReadyWait

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

ReadyWait is a structure that manages a channel to be used for simple readiness notification. The value of a structure like this over a Cond is that a channel can participate in a select

func MakeReadyWait

func MakeReadyWait() *ReadyWait

MakeReadyWait returns a new ReadyWait

func (*ReadyWait) Close

func (r *ReadyWait) Close()

Close closes the underlying ready channel

func (*ReadyWait) Notify

func (r *ReadyWait) Notify()

Notify wakes up any process waiting on the ready channel without blocking the calling routine

func (*ReadyWait) Wait

func (r *ReadyWait) Wait() <-chan struct{}

Wait returns the underlying channel and can be used to wait for the Notify method having been called

Jump to

Keyboard shortcuts

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