work

package
v1.4.2 Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package work provides a bounded worker pool utility for concurrent processing of any kind.

  • Copyright (c) 2025, NVIDIA CORPORATION. All rights reserved.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Callback

type Callback func(item string)

type Pool

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

func New

func New(numWorkers, chanCap int, cb Callback, abort <-chan error) *Pool

Other than self-explanatory parameters, the `abort <-chan error` is xaction's `xact.Base.ChanAbort()`

func (*Pool) IsBusy

func (p *Pool) IsBusy() bool

func (*Pool) NumDone

func (p *Pool) NumDone() int64

func (*Pool) Stop

func (p *Pool) Stop()

func (*Pool) TrySubmit

func (p *Pool) TrySubmit(item string) bool

func (*Pool) Wait

func (p *Pool) Wait()

Jump to

Keyboard shortcuts

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