workpool

package module
v0.0.0-...-62cbb12 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2024 License: Apache-2.0 Imports: 3 Imported by: 100

README

Workpool

Go Report Card Go Reference

Use a WorkPool to perform units of work concurrently at a maximum rate. The worker goroutines will increase to the maximum number of workers as work requires it, and gradually decrease to 0 if unused.

A Throttler performs a specified batch of work at a given maximum rate, internally creating a WorkPool and then stopping it when done.

[!NOTE]

This repository should be imported as code.cloudfoundry.org/workpool.

Docs

Contributing

See the Contributing.md for more information on how to contribute.

Working Group Charter

This repository is maintained by App Runtime Platform under Diego area.

[!IMPORTANT]

Content in this file is managed by the CI task sync-readme and is generated by CI following a convention.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Throttler

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

func NewThrottler

func NewThrottler(maxWorkers int, works []func()) (*Throttler, error)

func (*Throttler) Work

func (t *Throttler) Work()

type WorkPool

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

func NewWorkPool

func NewWorkPool(maxWorkers int) (*WorkPool, error)

func (*WorkPool) Stop

func (w *WorkPool) Stop()

func (*WorkPool) Submit

func (w *WorkPool) Submit(work func())

Jump to

Keyboard shortcuts

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