sourcegraph/internal/limiter/CODENOTIFY
Camden Cheek 0c42579d07
Consolidate dependencies: remove neelance/parallel (#48159)
We use the `neelance/parallel` package for two things right now:
1) a semaphore
2) a waitgroup/errgroup

It makes for a more-complex-than-necessary semaphore, and a non-standard
errgroup. We use it along with the `goroutine` package to log panics,
but most of the time, logging a panic is not really what we want. This
change was inspired by me getting confused by panics being swallowed in
tests.

This replaces uses of the package with a combination of
`sourcegraph/conc` and a new `internal/limiter`.

The new `internal/limiter` package is a very simple channel-based
semaphore, and I merged in the `internal/mutablelimiter` package so now
we have `limiter.New(n)` and `limiter.NewMutable(n)`.

`sourcegraph/conc` replaces the combination of `goroutine.Go()` and
`run.Acquire()`/`run.Release()` along with error collection and
cancellation in some cases. Additionally, it propagates panics rather
than just logging and ignoring them, which is often not good behavior.
2023-02-24 11:24:46 -07:00

2 lines
17 B
Plaintext