How zaidsasa/workerpool works
This is a small Go concurrency-limiting worker-pool library. Callers configure and create a pool, submit tasks, then wait for completion or context cancellation; the pool dispatches workers up to its semaphore limit. The graph reflects the sampled runtime source; it does not include tests or benchmark machinery.
Main entry points: workerpool.go Worker Pool · worker.go Worker · semaphore.go Semaphore · options.go Pool Options
Components 7
Pool API
- Worker Pool
workerpool.go - Pool Options
options.go
Task Execution
- Dispatcher
workerpool.go - Worker
worker.go - Task Queue
workerpool.go
Concurrency Control
- Semaphore
semaphore.go
Other components
- Caller
Connections 13
- Caller → Worker Pool: creates, submits, waits
- Worker Pool → Pool Options: parses options
- Worker Pool → Semaphore: creates limit
- Worker Pool → Dispatcher: starts
- Worker Pool → Task Queue: queues tasks
- Dispatcher → Semaphore: acquires capacity
- Dispatcher → Worker: starts workers
- Worker → Task Queue: receives tasks
- Worker → Semaphore: releases capacity
- Worker Pool → Worker: waits for completion
- Worker Pool → Task Queue: closes queue
- Dispatcher → Semaphore: closes on stop
- Worker → Worker Pool: signals task done