Comments (2)
Errors are surfaced using the same mechanisms that are used to surface errors when calling a function in a separate go routine. Typically this is a channel or by closure with synchronization. Treat calling wp.Submit(somefunc)
the same as calling go somefunc()
from workerpool.
@gammazero I reused your implementation and fully integrated it into an open-sourced async
package from my company. We can handle errors and context much better using a dedicated Task
struct instead of func()
.
https://github.com/jamestrandung/go-concurrency/tree/master/async#worker-pool
Are you open to listing my repo on your README as a sister repo :P? Contributions are welcome as well.
from workerpool.
Related Issues (20)
- New release with `Pause` method HOT 3
- Race condition testing HOT 3
- Stop job while running HOT 20
- Pause a workerpool through keyboard HOT 16
- How to avoid task queueing (handling priority) HOT 2
- support to change maxWorkers dynamically HOT 2
- codecov in .travis.yml - security issue HOT 1
- Possible memory leak HOT 8
- Why startWorker() and not worker()? HOT 2
- [feature request] naming workerpools
- Ability configure idle timeout. HOT 1
- Cannot work with deque 0.2.0 HOT 1
- What is the purpose of "r := r"? HOT 2
- Make Workers open and close a database connection HOT 3
- Bug - strange behavior HOT 1
- Wait on Submit until queue has HOT 1
- Is it possible for this pool to experience queue overflow? HOT 2
- required: update golang version
- run in background
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from workerpool.