package
Version:
v0.0.0-...-9b2948e
Opens a new window with list of versions in this module.
Published: Nov 16, 2024
License: MIT
Opens a new window with license information.
Imports: 0
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
README
¶
Worker pool
graph LR
subgraph Worker Pool
W1-->Task1
W2-->Task2
W3-->Task3
W4-->Task4
W5-->Task5
end
Task1-->Done
Task2-->Done
Task3-->Done
Task4-->Done
Task5-->Done
Done-->Result
TODO:
- Use
sync.Pool
or sync.Cond
to manage workers
- Add Graceful Shutdown
References
Looking for Alternatives? Peek Here:
Documentation
¶
type Result struct {
Value any
Error error
}
type WP interface {
Push(task ...func()) error
}
type WorkerPool struct {
Result chan Result
}
Close closes the task queue channel
Source Files
¶
Click to show internal directories.
Click to hide internal directories.