concurrent

package
v1.5.0 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateRoutinesAndWaitForFinish

func CreateRoutinesAndWaitForFinish(num int, f func())

CreateRoutinesAndWaitForFinish creates num of goroutines which all execute f() and wait for them to finish.

Types

type BroadcastChan

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

func NewBroadcastChan

func NewBroadcastChan(subscriberNum int) *BroadcastChan

func (*BroadcastChan) Broadcast

func (b *BroadcastChan) Broadcast()

func (*BroadcastChan) Close

func (b *BroadcastChan) Close()

func (*BroadcastChan) TotalHungChan

func (b *BroadcastChan) TotalHungChan() <-chan struct{}

func (*BroadcastChan) Wait

func (b *BroadcastChan) Wait() bool

type Counter

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

func NewCounter

func NewCounter(count, total int) *Counter

func (*Counter) Decrease

func (c *Counter) Decrease() (int, int)

func (*Counter) Increase

func (c *Counter) Increase() (int, int)

func (*Counter) IncreaseTotal

func (c *Counter) IncreaseTotal() (int, int)

func (*Counter) Value

func (c *Counter) Value() (int, int)

Value return count and total

type List

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

func NewList

func NewList() *List

func (*List) GetItems

func (l *List) GetItems() *list.List

func (*List) Len

func (l *List) Len() int

func (*List) PopFront

func (l *List) PopFront() any

func (*List) PushBack

func (l *List) PushBack(value any)

func (*List) PushBackList

func (l *List) PushBackList(other *List)

func (*List) PushFront

func (l *List) PushFront(value any)

func (*List) Reset

func (l *List) Reset()

Jump to

Keyboard shortcuts

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