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

Add experimental s2 support #11

Merged
merged 1 commit into from
Jul 24, 2022
Merged

Add experimental s2 support #11

merged 1 commit into from
Jul 24, 2022

Conversation

mostynb
Copy link
Owner

@mostynb mostynb commented Jul 7, 2022

No description provided.

s2/s2.go Outdated
func init() {
c := &compressor{}
c.poolCompressor.New = func() interface{} {
w := s2.NewWriter(ioutil.Discard, s2.WriterConcurrency(1))
Copy link
Owner Author

Choose a reason for hiding this comment

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

TODO: check if this is leaky. s2.NewWriter docs say that resources might not be released if Close isn't called (as would happen with sync.Pool):

Users must call Close to guarantee all data has been forwarded to the underlying io.Writer and that resources are released. They may also call Flush zero or more times before calling Close.

@mostynb mostynb merged commit 20f220e into main Jul 24, 2022
@mostynb mostynb deleted the add_s2 branch July 24, 2022 13:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant