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

feat: sync.EagerGroup #425

Merged
merged 9 commits into from Apr 12, 2024
Merged

feat: sync.EagerGroup #425

merged 9 commits into from Apr 12, 2024

Conversation

Sidddddarth
Copy link
Member

@Sidddddarth Sidddddarth commented Apr 10, 2024

Description

EagerGroup

A sync group(g.Go(f func() error)) that tries to not initialise new goroutines or running the function provided(f) if the context's cancelled.
Otherwise works just like golang.org/x/sync/errgroup.
Use NewEagerGroup(ctx, n) for a new eager group, panics otherwise.
Limits only if n > 0

Bonus

Added github workflow concurrency groups as well.

Linear Ticket

< Replace_with_Linear_Link >

Security

  • The code changed/added as part of this pull request won't create any security issues with how the software is being used.

sync/group.go Outdated Show resolved Hide resolved
sync/group.go Outdated Show resolved Hide resolved
sync/group.go Outdated Show resolved Hide resolved
sync/group.go Outdated Show resolved Hide resolved
Sidddddarth and others added 5 commits April 10, 2024 23:03
Co-authored-by: Leonidas Vrachnis <leo.al.vra@gmail.com>
Co-authored-by: Leonidas Vrachnis <leo.al.vra@gmail.com>
@fracasula fracasula enabled auto-merge (squash) April 12, 2024 13:49
@Sidddddarth Sidddddarth changed the title feat: sync.Group feat: sync.EagerGroup Apr 12, 2024
@fracasula fracasula merged commit ac91461 into main Apr 12, 2024
10 checks passed
@fracasula fracasula deleted the feat.syncGroup branch April 12, 2024 14:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants