concurrency

package
v1.17.0 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2022 License: Apache-2.0 Imports: 1 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package concurrency contains utilities for goroutines coordination

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Executed

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

Executed can be used to wait for something to be executed, it has a similar semantics to sync.Cond, but with a way to know whether it was already executed once and waiting only if that's not the case.

func NewExecuted

func NewExecuted() *Executed

NewExecuted creates a new Executed

func (*Executed) Broadcast

func (i *Executed) Broadcast()

Broadcast broadcasts execution to waiting goroutines

func (*Executed) Wait

func (i *Executed) Wait()

Wait waits for execution

type MultipleExecuted

type MultipleExecuted []*Executed

MultipleExecuted can be used to wrap multiple Executed conditions that should all be waited

func (MultipleExecuted) Wait

func (m MultipleExecuted) Wait()

Wait waits for the execution for all the conditions in a MultipleExecuted

Jump to

Keyboard shortcuts

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