async

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2022 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AtomicBool

type AtomicBool int32

Thread safe atomic bool

func NewAtomicBool

func NewAtomicBool(value bool) *AtomicBool

NewAtomicBool creates an AtomicBool with given default value

func (*AtomicBool) CompareAndSet

func (ab *AtomicBool) CompareAndSet(current, new bool) bool

CompareAndSet sets value to new if current is equal to the current value

func (*AtomicBool) Get

func (ab *AtomicBool) Get() bool

Loads the bool value atomically

func (*AtomicBool) Set

func (ab *AtomicBool) Set(value bool)

Sets the bool value atomically

type ConcurrentStringSet

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

ConcurrentStringSet is a thread-safe set of string values

func NewConcurrentStringSet

func NewConcurrentStringSet() *ConcurrentStringSet

Creates a new ConcurrentStringSet

func (*ConcurrentStringSet) Add

func (css *ConcurrentStringSet) Add(value string)

Adds a string to the set

func (*ConcurrentStringSet) Contains

func (css *ConcurrentStringSet) Contains(value string) bool

Whether or not the set contains a string

func (*ConcurrentStringSet) Remove

func (css *ConcurrentStringSet) Remove(value string)

Removes a string from the set

type WaitChannel

type WaitChannel interface {
	Add(delta int)
	Done()
	Wait() <-chan struct{}
}

WaitChannel behaves like a WaitGroup, but returns a channel on Wait()

func NewWaitChannel

func NewWaitChannel() WaitChannel

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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