waitgroup

package
v0.5.0-79-ge68aa34 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2023 License: BSD-3-Clause Imports: 1 Imported by: 0

Documentation

Overview

The internal `waitgroup` package is a generic which provides a synchronization lock to read observe a list of provided entities.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type WaitGroup

type WaitGroup[T comparable] struct {
	// contains filtered or unexported fields
}

func (*WaitGroup[T]) Add

func (wg *WaitGroup[T]) Add(k T)

Add to the wait group.

func (*WaitGroup[T]) Contains

func (wg *WaitGroup[T]) Contains(needle T) bool

Contains checks if the provided entity is still in the wait group.

func (*WaitGroup[T]) Done

func (wg *WaitGroup[T]) Done(needle T)

Done signals that the provided entity can be removed from the wait group.

func (*WaitGroup[T]) Items

func (wg *WaitGroup[T]) Items() []T

Items returns the list of items in the wait group.

func (*WaitGroup[T]) Wait

func (wg *WaitGroup[T]) Wait()

Wait for all items in the wait group to be removed.

Jump to

Keyboard shortcuts

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