throttler

package
v1.2.13 Latest Latest
Warning

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

Go to latest
Published: Aug 17, 2023 License: GPL-3.0 Imports: 2 Imported by: 3 modules, 10 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type NumGoRoutinesThrottler

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

NumGoRoutinesThrottler can limit the number of go routines launched

func NewNumGoRoutinesThrottler

func NewNumGoRoutinesThrottler(max int32) (*NumGoRoutinesThrottler, error)

NewNumGoRoutinesThrottler creates a new num go routine throttler instance

func (*NumGoRoutinesThrottler) CanProcess

func (ngrt *NumGoRoutinesThrottler) CanProcess() bool

CanProcess returns true if current counter is less than max

func (*NumGoRoutinesThrottler) EndProcessing

func (ngrt *NumGoRoutinesThrottler) EndProcessing()

EndProcessing will decrement current counter

func (*NumGoRoutinesThrottler) IsInterfaceNil

func (ngrt *NumGoRoutinesThrottler) IsInterfaceNil() bool

IsInterfaceNil returns true if there is no value under the interface

func (*NumGoRoutinesThrottler) StartProcessing

func (ngrt *NumGoRoutinesThrottler) StartProcessing()

StartProcessing will increment current counter

Jump to

Keyboard shortcuts

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