throttler

package
v1.999.0 Latest Latest
Warning

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

Go to latest
Published: Nov 17, 2022 License: GPL-3.0 Imports: 2 Imported by: 8

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