pools

package
v2.1.0 Latest Latest
Warning

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

Go to latest
Published: May 21, 2023 License: MIT, MIT Imports: 1 Imported by: 0

Documentation

Overview

Package pools : goroutine pools

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Pool

type Pool interface {
	// Wait 等待令牌
	Wait()
	// Done 归还令牌
	Done()
	// Num 当前发放的令牌书
	Num() int
	// Size 总令牌数
	Size() int

	// WaitAll 同步等待令牌全部归还
	WaitAll()
	// AsyncWaitAll 异步等待令牌全部归还
	AsyncWaitAll() <-chan struct{}
}

Pool goroutine pool

func NewPool

func NewPool(size int) Pool

NewPool return a new pool

Jump to

Keyboard shortcuts

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