You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
> A lightweight, type-safe, and retryable asynchronous worker pool for Go — built on **`sync.WaitGroup`**, **semaphores**, **context**, and **condition variables**, _not_`errgroup`.
10
+
> A lightweight, type-safe, and retryable concurrent worker pool for Go — built on **`sync.WaitGroup`**, **semaphores**, **context**, and **condition variables**, _not_`errgroup`.
11
11
12
-
`go-async` provides deterministic, leak-free concurrency with automatic retries, result draining, and type-safe tasks, suitable for high-throughput Go applications.
12
+
`go-pool` provides deterministic, leak-free concurrency with automatic retries, result draining, and type-safe tasks, suitable for high-throughput Go applications.
13
13
14
14
---
15
15
16
-
## ✨ Features
16
+
## Features
17
17
18
-
-✅ Type-safe generic workers (`Task[T]`)
19
-
-🧩 Graceful error propagation
20
-
-🔁 Built-in retry with exponential backoff + jitter
21
-
-⚡ Asynchronous result draining (`Drain`)
22
-
-🧵 Deterministic shutdown (no goroutine leaks)
23
-
-🔒 Mutex + condition variable–protected data aggregation
| ChannelsWithOutputAndErrChannel-32 | 259.9 | 2 | 72 B |
164
164
| ChannelsWithWaitGroup-32 | 272.8 | 2 | 80 B |
165
165
| MutexWithErrGroup-32 | 270.9 | 2 | 102 B |
166
-
|AsyncPackageWithDrainer-32 | 277.5 | 4 | 162 B |
166
+
|GoPoolWithDrainer-32| 277.5 | 4 | 162 B |
167
167
| ChannelsWithErrGroup-32 | 279.5 | 2 | 80 B |
168
-
|AsyncPackage-32 | 297.4 | 3 | 96 B |
168
+
|GoPool-32| 297.4 | 3 | 96 B |
169
169
170
170

171
171
172
-
Even though `go-async` adds a small constant overhead compared to `errgroup` (≈100–130 ns per operation),
172
+
Even though `go-pool` adds a small constant overhead compared to `errgroup` (≈100–130 ns per operation),
173
173
it provides type safety, retries, automatic draining, and deterministic cleanup — all while staying within ~1.7× of native concurrency performance.
174
174
175
-
### 🧩 Benchmark Insights
175
+
### Benchmark Insights
176
176
177
-
-`AsyncPackage` and `AsyncPackageWithDrainer` show consistent sub-microsecond operation times.
177
+
-`GoPool` and `GoPoolWithDrainer` show consistent sub-microsecond operation times.
178
178
- Memory allocations remain extremely low — under 250 B/op even with drainer support.
179
179
- The performance delta vs `errgroup` reflects controlled synchronization overhead (mutex + condition variable).
180
-
- In practice, `go-async` scales linearly with worker count and maintains predictable latency under load.
180
+
- In practice, `go-pool` scales linearly with worker count and maintains predictable latency under load.
181
181
182
182
---
183
183
184
-
## ⚡ Design Highlights
184
+
## Design Highlights
185
185
186
186
- Structured concurrency with `sync.WaitGroup`
187
187
- Controlled parallelism via semaphores
@@ -202,20 +202,20 @@ it provides type safety, retries, automatic draining, and deterministic cleanup
202
202
203
203
### Drainer (Drain)
204
204
205
-
- Create via `async.NewDrainer[T]()`
205
+
- Create via `pool.NewDrainer[T]()`
206
206
- Use `Send()` to safely push results
207
207
- Collect values using `Drain()`
208
208
- Internally guarded by `sync.Mutex` and `sync.Cond`
209
209
210
210
### Task and Worker Management
211
211
212
-
- Wrap async functions with `async.NewTask()`
212
+
- Wrap async functions with `pool.NewTask()`
213
213
- Chain configuration fluently using `.WithRetry()` and `.DrainTo()`
214
214
- Provide inputs using `.WithInput()`
215
215
216
216
### Pool
217
217
218
-
- Use `async.NewPool()` for controlled concurrency
218
+
- Use `pool.NewPool()` for controlled concurrency
219
219
- Limit parallelism with `.WithLimit(limit)`
220
220
- Apply retry policy globally with `.WithRetry(attempts, sleep)`
221
221
- Wait for all tasks to complete using `.Wait()`
@@ -232,9 +232,9 @@ go test -bench . -benchmem -memprofile=mem.prof
232
232
```
233
233
---
234
234
235
-
## 💬 Summary
235
+
## Summary
236
236
237
-
`go-async` provides a modern, type-safe, and retryable abstraction over Go’s native synchronization primitives — combining simplicity, determinism, and high throughput.
237
+
`go-pool` provides a modern, type-safe, and retryable abstraction over Go’s native synchronization primitives — combining simplicity, determinism, and high throughput.
238
238
239
239
Built for developers who want concurrency that’s:
240
240
@@ -245,6 +245,6 @@ Built for developers who want concurrency that’s:
0 commit comments