co

package
v2.5.1 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2026 License: LGPL-3.0 Imports: 3 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Parallel

func Parallel(cb func(chan<- func())) <-chan struct{}

Parallel to run a batch of work using as many CPU as it can.

Types

type Signal

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

Signal a rendezvous point for goroutines waiting for or announcing the occurrence of an event. It's more friendly than sync.Cond, since it's channel based. That means you can do channel selection to wait for an event.

func (*Signal) Broadcast

func (s *Signal) Broadcast()

Broadcast wakes all goroutines that are waiting on s.

func (*Signal) NewWaiter

func (s *Signal) NewWaiter() Waiter

NewWaiter create a Waiter object for acquiring channel to wait for.

type Waiter

type Waiter interface {
	C() <-chan bool
}

Waiter provides channel to wait for.

Jump to

Keyboard shortcuts

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