Skip to content

Conversation

@divyam234
Copy link
Contributor

Added support for closing streams

@petergardfjall
Copy link

Hey, what's the status on this PR?
We're also in need of passing io.ReadClosers to be able to stream back quite large files.

@divyam234
Copy link
Contributor Author

divyam234 commented Apr 9, 2025

@ernado @tdakkota Can you approve this?

@divyam234 divyam234 changed the title close reader if its satisfies io.Closer close reader if it satisfies io.Closer Apr 9, 2025
@petergardfjall
Copy link

Just to hammer home the soundness of the approach, this is very similar to how the Go standard library handles the http.Request which also accepts an io.Reader, but behind the scenes the library will make sure it's a io.ReadCloser [1].

[1] https://cs.opensource.google/go/go/+/refs/tags/go1.24.2:src/net/http/request.go;l=906-909

@ernado
Copy link
Member

ernado commented Apr 18, 2025

@tdakkota PTAL

@ernado ernado enabled auto-merge April 18, 2025 13:40
@ernado ernado merged commit e77136e into ogen-go:main Apr 18, 2025
15 checks passed
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.

3 participants