Skip to content

V2: Rework the entire library to use github.com/alitto/pond/v2 - #3

Merged
mellie-bee merged 27 commits into
mainfrom
formigo-v2-pond
Oct 15, 2026
Merged

mellie-bee merged 27 commits into
mainfrom
formigo-v2-pond

Conversation

@mellie-bee

Copy link
Copy Markdown

This is a fairly major change, but it's also fully end-to-end testable using the included helper programs and is small/simple enough to explain on a single sheet of paper.

The way this works is extremely simple:

Screenshot 2026-09-30 at 13 28 49

Context cancellation powers the entire shutdown: when calling manager.Run(ctx), it waits on <-ctx.Done(). This is the only exit condition, and shuts down the fetchers (cancelling their context and ending them) first, followed by the workers.

select {
case <-ctx.Done():
	fetcher.StopAndWait()
	m.pool.StopAndWait()
	return ctx.Err()
}

see v2/cmd/echo/main.go for a full, complete example of how to use this as a consumer.

@leegm-pp leegm-pp left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Partial review - will have a further look tomorrow. Couple of thoughts so far though

Comment thread v2/manager.go Outdated
Comment thread v2/manager.go
Comment thread v2/manager.go Outdated
Comment thread v2/manager.go Outdated
Comment thread v2/manager.go Outdated
Comment thread v2/manager.go Outdated
Comment thread v2/manager_test.go
Comment thread v2/manager.go Outdated
Comment thread v2/manager.go
Comment thread v2/manager.go Outdated
Comment thread v2/manager.go Outdated
Comment thread v2/manager.go Outdated
Comment thread v2/manager.go Outdated
Comment thread v2/manager.go
Comment thread .github/workflows/test.yml
@mellie-bee
mellie-bee merged commit 165f4b5 into main Oct 15, 2026
5 of 6 checks passed
@github-actions

Copy link
Copy Markdown

🎉 This PR is included in version 1.0.2 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

2 participants