Re: [go-nuts] parallel blake3, broadcast non-zero values, wait-groups integrated with chan

2025-02-15 Thread Nagaev Boris
Hey Jason, To implement such a mechanism, you can use GoroutineManager to manage upload workers. Each worker receives a context.Context as an argument, which allows for graceful shutdown. When you detect an out-of-space condition, you simply call GoroutineManager.Stop(), which cancels the context

Re: [go-nuts] parallel blake3, broadcast non-zero values, wait-groups integrated with chan

2025-02-15 Thread Jason E. Aten
Thanks Boris. I promised Boris I would explain the problem that the idem library solves with traditional sync.WaitGroup usage, as found in his referenced library, if he posted his suggestion back here on the list instead of in a dm, so here goes: Imagine you have a backup server that you are

Re: [go-nuts] parallel blake3, broadcast non-zero values, wait-groups integrated with chan

2025-02-15 Thread robert engels
This sounds incorrect to me. I think the better approach might be to signal/cancel the jobs, and as the jobs cancel themselves, they will decrement the waitGroup - releasing the waiter eventually. A shared context across the jobs in a pool seems natural. > On Feb 15, 2025, at 4:18 PM, Jason E.

Re: [go-nuts] parallel blake3, broadcast non-zero values, wait-groups integrated with chan

2025-02-15 Thread Nagaev Boris
On Thu, Feb 13, 2025 at 6:11 PM Jason E. Aten wrote: > 3) I almost always need to know when my goroutines are done, > > and to shut them all down in case of an error from one. > > > My idem package provides goroutine supervision trees > > and also shows how to integrate sync.WaitGroup-style > > t