From 8d1cf3f165858ddc1b24b23c39dec187140bd927 Mon Sep 17 00:00:00 2001 From: Alessandro Resta Date: Wed, 13 May 2026 16:45:36 +0300 Subject: [PATCH] Describe execution and shutdown semantics in README --- README.md | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/README.md b/README.md index 6193e4f..c23ad8f 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,15 @@ Generic, type-safe handy worker pool in Go. + +It executes tasks using a fixed number of worker goroutines passed to the pool constructor. + +Task submission is coordinated through a buffered channel. The buffer size is configurable and defines the maximum number of tasks that can be queued before backpressure is applied. When the buffer is full, `Submit` blocks until capacity becomes available. + +The pool supports both immediate cancellation via context and graceful shutdown. + +Immediate cancellation stops workers and drops queued tasks that have not yet started execution, while graceful shutdown drains all queued tasks and waits for completion. In both cases, in-flight tasks are allowed to complete. + ## Install ```bash