File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -48,9 +48,12 @@ type Option func(*WorkerPool)
4848// - [Drain] will return [ErrCallbackSet] instead of collecting results
4949// - Results are processed immediately upon completion, avoiding memory
5050// buildup
51- // - The callback fn may be invoked concurrently from multiple goroutines
5251//
53- // The callback fn must be safe for concurrent use.
52+ // The callback fn is invoked from the worker goroutines.
53+ // This has a few implications:
54+ // 1. fn must be safe for concurrent use.
55+ // 2. fn must NOT call [Submit] nor [Close] as it will lead to a deadlock.
56+ //
5457// WithResultCallback panics if fn is nil.
5558func WithResultCallback (fn func (Result )) Option {
5659 // TODO(v2): New/NewWithContext should return an error so that option
You can’t perform that action at this time.
0 commit comments