npool

package
v0.0.0-...-41ea26f Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Pool

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

func New

func New(name string, size int) *Pool

New constructs a new worker pool of the specified size.

func (*Pool) Get

func (p *Pool) Get(ctx context.Context) (*Worker, error)

type Worker

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

Worker represents the permission to do work.

func (Worker) Done

func (w Worker) Done()

Done returns this worker to the pool.

func (Worker) String

func (w Worker) String() string

String returns the name & ID of this worker.

Jump to

Keyboard shortcuts

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