workqueue

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2026 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Overview

Package workqueue contains a workqueue with bounded concurrency.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type WorkQueue

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

WorkQueue is a simple work queue with bounded concurrency, optionally buffered. Intended for IO operations. The queue will work through work items with the given level of concurrency.

func New

func New(cap, buffer int) *WorkQueue

func (*WorkQueue) Capacity

func (p *WorkQueue) Capacity() int

Capacity returns the maximum number of go routines the pool can use.

func (*WorkQueue) Chan

func (p *WorkQueue) Chan() chan<- func()

Chan returns the ingestion channel for incoming work.

func (*WorkQueue) Close

func (p *WorkQueue) Close()

func (*WorkQueue) Resize

func (p *WorkQueue) Resize(cap int)

Resize sets the maximum number of go routines to use. At least 1.

func (*WorkQueue) Size

func (p *WorkQueue) Size() int

Size returns the number of go routines in use.

Jump to

Keyboard shortcuts

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