Categorygithub.com/safeblock-dev/wr
module
0.1.1
Repository: https://github.com/safeblock-dev/wr.git
Documentation: pkg.go.dev

# README

WR

GoPool

gopool is a Go library that provides a goroutine pool for efficient task execution. It allows you to manage a fixed number of goroutines to execute tasks concurrently, reducing the overhead of creating and destroying goroutines frequently.

SyncGroup

syncgroup enhances Go's sync.WaitGroup with additional features such as panic recovery and custom panic handlers. It simplifies the management of goroutines, ensuring that any panics are handled gracefully and that all goroutines complete before proceeding.

TaskGroup

taskgroup offers a way to group related tasks and manage their execution as a unit. It supports interruptible tasks and automatic error propagation, making it easier to handle errors and control the flow of concurrent tasks.

GoStream

gostream provides a framework for executing tasks concurrently while ensuring that their callbacks are executed sequentially. This is useful for maintaining consistency when processing results from multiple concurrent operations.

GoStreamCh

gostreamch extends gostream by providing error handling capabilities. It allows you to submit tasks that may return errors and provides an error channel to retrieve these errors asynchronously.

GoPoolCh

gopoolch is an extension of gopool that includes custom panic and error handlers. It allows you to manage goroutines efficiently with built-in panic recovery and error handling mechanisms.

Installation

go get github.com/safeblock-dev/wr

Examples:

Benchmark Results

System Software Overview:

Device: MacBook Air, M1
System Version: macOS 14.1 (23B74)
Kernel Version: Darwin 23.1.0

Pool

BenchmarkIterationsTime (ns/op)Memory (B/op)Allocations (allocs/op)
Default17,376,734321.1884
Gopool16,261,023366.4333
WR15,597,608368.4333
Conc16,494,992411.0664
Ants16,887,066415.0403
Pond6,872,601901.6323

Stream

BenchmarkIterationsTime (ns/op)Memory (B/op)Allocations (allocs/op)
Conc14,056,011435.81047
WR11,183,976505.81127

SyncGroup

BenchmarkIterationsTime (ns/op)Memory (B/op)Allocations (allocs/op)
Default1,875,888311354131
Conc1,769,134346970741
WR1,780,732369970741

TaskGroup

BenchmarkIterationsTime (ns/op)Memory (B/op)Allocations (allocs/op)
WR1,714,4833492168059
Run1,512,8823975156057

# Packages

No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author