Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document how to handle errors, please #54

Open
zapman449 opened this issue Aug 13, 2021 · 2 comments
Open

Document how to handle errors, please #54

zapman449 opened this issue Aug 13, 2021 · 2 comments

Comments

@zapman449
Copy link

How do you surface errors in your tasks?

@gammazero
Copy link
Owner

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()

@jamestrandung
Copy link

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants