Reader: Changing responsiveness should wake blocked reads

This commit is contained in:
Matt Joiner 2018-01-06 16:40:35 +11:00
parent 57fec52371
commit 23363506f5
1 changed files with 2 additions and 0 deletions

View File

@ -50,11 +50,13 @@ var _ io.ReadCloser = &reader{}
// soon as they can when the underlying chunks become available.
func (r *reader) SetResponsive() {
r.responsive = true
r.t.cl.event.Broadcast()
}
// Disable responsive mode. TODO: Remove?
func (r *reader) SetNonResponsive() {
r.responsive = false
r.t.cl.event.Broadcast()
}
// Configure the number of bytes ahead of a read that should also be