Browse Source

asyncbuffer.NewReadFull

Viktor Sokolov 3 months ago
parent
commit
f1607de141
1 changed files with 3 additions and 0 deletions
  1. 3 0
      asyncbuffer/buffer.go

+ 3 - 0
asyncbuffer/buffer.go

@@ -109,6 +109,9 @@ func NewReadFull(r io.ReadCloser, dataLen int, finishFn ...context.CancelFunc) (
 		finishFn:  finishFn,
 	}
 
+	// Release the paused latch so that the reader can read all data immediately
+	ab.paused.Release()
+
 	// Read all data in foreground
 	ab.readChunks()