-
Notifications
You must be signed in to change notification settings - Fork 380
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 CloserListerAt #577
add CloserListerAt #577
Conversation
request.go
Outdated
@@ -229,6 +241,8 @@ func (r *Request) close() error { | |||
} | |||
}() | |||
|
|||
r.state.closeListerAt() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
err := r.state.closeListerAt()
Perhaps? This obviates the need for line 248 as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe we can just check for io.Closer like for readers/writers instead of extending the interface
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I think that’s a simpler mor direct change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
The
ListerAt
is stored in theRequest
state and reused across requests. Some implementations don't store the entire[]os.FileInfo
buffer in theListerAt
implementation but instead return an open file and get/return[]os.FileInfo
on request. For these implementation aClose
method is required.The use case is if you want to list a large directory on memory constrained systems.