-
Notifications
You must be signed in to change notification settings - Fork 325
Comparing changes
Open a pull request
base repository: sourcegraph/conc
base: v0.3.0
head repository: sourcegraph/conc
compare: main
- 19 commits
- 29 files changed
- 6 contributors
Commits on Feb 27, 2023
-
Added successful case for context pool, returns before timeout (#94)
I think we need an example of, if the tasks return before the context cancelled due to timeout, it should success Co-authored-by: Camden Cheek <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for ba7ce51 - Browse repository at this point
Copy the full SHA ba7ce51View commit details
Commits on Mar 3, 2023
-
Configuration menu - View commit details
-
Copy full SHA for 1d4991d - Browse repository at this point
Copy the full SHA 1d4991dView commit details
Commits on Apr 10, 2023
-
Allow pools to be reusable (#108)
Fixes #103. See inline comments for rationale.
Configuration menu - View commit details
-
Copy full SHA for 06d3061 - Browse repository at this point
Copy the full SHA 06d3061View commit details
Commits on May 3, 2023
-
always spawn a worker with the task it was supposed to complete (#112)
For "unlimited" pools, in the original code: ```go p.handle.Go(p.worker) p.tasks <- f ``` If in between the call to `handle.Go` and sending the task to the worker, another goroutine would call `pool.Go`, that task would "hijack" the newly created worker, causing the original send to block. This is undesirable behavior if the pool is unlimited. The solution was to add an `initialFunc` to the worker, which will be executed before the worker starts waiting for new tasks. This ensures that a worker will first complete the task it was supposed to, then complete others.
Configuration menu - View commit details
-
Copy full SHA for 8e5ba59 - Browse repository at this point
Copy the full SHA 8e5ba59View commit details
Commits on Jun 1, 2023
-
In #104, a "FailFast" option is likely going to be added to iterators that, on error, stops running additional tasks and returns the error that caused the first failure. "FailFast" seems is a pretty standard description for this behavior, and combining two common options into a single option with a more discoverable name seems like a nice thing to do before 1.0.
Configuration menu - View commit details
-
Copy full SHA for 995000d - Browse repository at this point
Copy the full SHA 995000dView commit details -
Configuration menu - View commit details
-
Copy full SHA for 7a31dff - Browse repository at this point
Copy the full SHA 7a31dffView commit details
Commits on Jun 2, 2023
-
We use the new error facilities when built with go 1.20, so this TODO no longer applies.
Configuration menu - View commit details
-
Copy full SHA for b3c39d3 - Browse repository at this point
Copy the full SHA b3c39d3View commit details
Commits on Nov 12, 2023
-
Use *_test packages to make examples copy-pasteable (#124)
The main reason for this PR was to make the examples in documentation copy-pasteable, but there are some additional benefits too. For example, the pool example before this change: ```go p := New().WithMaxGoroutines(3) for i := 0; i < 5; i++ { p.Go(func() { fmt.Println("conc") }) } p.Wait() ``` and after: ```go p := pool.New().WithMaxGoroutines(3) // has package name for i := 0; i < 5; i++ { p.Go(func() { fmt.Println("conc") }) } p.Wait() ```
Configuration menu - View commit details
-
Copy full SHA for abd9a8b - Browse repository at this point
Copy the full SHA abd9a8bView commit details -
only execute stream callback when non-nil (#121)
Currently, if `nil` is returned as a stream callback, it will cause a panic because we try to call a `nil` func. This makes it valid to return a `nil` callback from the stream job, which just does nothing on callback.
Configuration menu - View commit details
-
Copy full SHA for b528efd - Browse repository at this point
Copy the full SHA b528efdView commit details -
Configuration menu - View commit details
-
Copy full SHA for b7b9417 - Browse repository at this point
Copy the full SHA b7b9417View commit details -
remove obsolete build directives
The `//go:build` directive was added in go 1.18, but this module requires at least go 1.19, so the old version of these build directives is unnecessary.
Configuration menu - View commit details
-
Copy full SHA for a68c69f - Browse repository at this point
Copy the full SHA a68c69fView commit details -
Configuration menu - View commit details
-
Copy full SHA for 30a99cd - Browse repository at this point
Copy the full SHA 30a99cdView commit details
Commits on Jan 8, 2024
-
Multierror: join errors at the end (#132)
This fixes `MapErr` so that it does not create recursive `joinError`s. By repeatedly calling `errors.Join(`, we create a nested set of `joinError`s rather than a single, flat `joinError`. Then, when `Error()` is called, it allocates a new string for each nested error because `joinError` calls `Error()` recursively on each of its children. Instead, this PR updates `MapErr` to just collect a slice of errors and return the flat joined error.
Configuration menu - View commit details
-
Copy full SHA for 4afefce - Browse repository at this point
Copy the full SHA 4afefceView commit details
Commits on Jan 19, 2024
-
Make result order deterministic (#126)
This makes the order of results in a `Result.*Pool` deterministic so that the order of the result slice corresponds with the order of tasks submitted. As an example of why this would be useful, it makes it easy to rewrite `iter.Map` in terms of `ResultPool`. Additionally, it's a generally nice and intuitive property to be able to match the index of the result slice with the index of the input slice.
Configuration menu - View commit details
-
Copy full SHA for 8427ccd - Browse repository at this point
Copy the full SHA 8427ccdView commit details -
This updates the pool types that collect results and errors to reset on `Wait` so they are reusable once waited on. Previously, if a pool was reused, the returned values of `Wait()` would contain the aggregated set of all previous uses. This wasn't explicitly a guarantee of the library before, but it does make it operate more like `sync.WaitGroup` and it's easy to do, so I think it's a positive change.
Configuration menu - View commit details
-
Copy full SHA for 4c5c70a - Browse repository at this point
Copy the full SHA 4c5c70aView commit details -
Exclusively use go1.20 multierrors (#127)
This removes the dependency on `go.uber.org/multierror` in favor of the multierror functionality included in go 1.20.
Configuration menu - View commit details
-
Copy full SHA for e454401 - Browse repository at this point
Copy the full SHA e454401View commit details
Commits on Jan 21, 2024
-
add Makefile and run benchmarks as part of PRs (#130)
This: - Adds a Makefile with `make test` and `make lint` and `make bench` - Adds a new workflow for `main` that runs benchmarks and saves them - Adds a new workflow for PRs that runs benchmarks and compares against `main`. When a benchmark regression occurs, it should fail the workflow
Configuration menu - View commit details
-
Copy full SHA for 1124809 - Browse repository at this point
Copy the full SHA 1124809View commit details -
Configuration menu - View commit details
-
Copy full SHA for a3ac5f2 - Browse repository at this point
Copy the full SHA a3ac5f2View commit details -
Configuration menu - View commit details
-
Copy full SHA for 5f936ab - Browse repository at this point
Copy the full SHA 5f936abView commit details
This comparison is taking too long to generate.
Unfortunately it looks like we can’t render this comparison for you right now. It might be too big, or there might be something weird with your repository.
You can try running this command locally to see the comparison on your machine:
git diff v0.3.0...main