add CloserListerAt#577
Merged
Merged
Conversation
puellanivis
reviewed
Feb 9, 2024
puellanivis
reviewed
Feb 9, 2024
| } | ||
| }() | ||
|
|
||
| r.state.closeListerAt() |
Collaborator
There was a problem hiding this comment.
err := r.state.closeListerAt()
Perhaps? This obviates the need for line 248 as well.
Collaborator
Author
There was a problem hiding this comment.
maybe we can just check for io.Closer like for readers/writers instead of extending the interface
Collaborator
There was a problem hiding this comment.
Yeah, I think that’s a simpler mor direct change.
Collaborator
Author
There was a problem hiding this comment.
Yeah, I think that’s a simpler mor direct change.
Done
311ff0d to
8fe951f
Compare
The ListerAt is stored in the Request state and reused across requests. Some implementations don't store the entire []os.FileInfo buffer in the ListerAt implementation but instead return an open file and get/return []os.FileInfo on request. For these implementation calling Close is required
8fe951f to
fbb0b8b
Compare
puellanivis
approved these changes
Apr 9, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
ListerAtis stored in theRequeststate and reused across requests. Some implementations don't store the entire[]os.FileInfobuffer in theListerAtimplementation but instead return an open file and get/return[]os.FileInfoon request. For these implementation aClosemethod is required.The use case is if you want to list a large directory on memory constrained systems.