zsync

package
v0.6.5 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2022 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MaxLimiter

type MaxLimiter struct {
	Active  int
	Pending int
	Max     int
	// contains filtered or unexported fields
}

func NewMaxLimiter

func NewMaxLimiter(max int) *MaxLimiter

Keep number of active locks below the Max count. Useful for limiting the number of goroutines running simultaneously

func (*MaxLimiter) Lock

func (l *MaxLimiter) Lock()

Lock will wait until Active < Max

func (*MaxLimiter) Unlock

func (l *MaxLimiter) Unlock()

Must call unlock when work is completed

Jump to

Keyboard shortcuts

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