gool

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2025 License: MIT Imports: 2 Imported by: 0

README

Gool

Package gool offers a high-level API for running tasks asynchronously, restricting concurrent executions to the number of cpu cores or a specified limit.

Documentation

Overview

Package gool offers a high-level API for running tasks asynchronously, restricting concurrent executions to the number of cpu cores or a specified limit.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Gool

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

Gool manages a pool of goroutines for asynchronous task execution.

func Cpu

func Cpu() *Gool

Cpu initializes a Gool instance with a global concurrency limit specified by cpu cores.

func New

func New(n int) *Gool

New initializes a Gool instance with a custom concurrency limit specified by n.

func (*Gool) Call

func (g *Gool) Call(f func())

Call submits a function f for asynchronous execution in a new goroutine, respecting the concurrency limit.

func (*Gool) Lock

func (g *Gool) Lock(f func())

Lock executes function f with exclusive access, synchronizing via the mutex, typically for aggregating results.

func (*Gool) Wait

func (g *Gool) Wait()

Wait blocks until all submitted tasks have completed.

Directories

Path Synopsis
cmd
sha256 command

Jump to

Keyboard shortcuts

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