Close implements io.Closer. it cancels prefetching and releases resources.
()
| 132 | // Close implements io.Closer. |
| 133 | // it cancels prefetching and releases resources. |
| 134 | func (p *StreamPipe) Close() error { |
| 135 | p.closeOnce.Do(func() { |
| 136 | p.cancel() |
| 137 | }) |
| 138 | return nil |
| 139 | } |
| 140 | |
| 141 | // prefetch runs in a goroutine, fetching blocks concurrently and sending to blockQueue. |
| 142 | func (p *StreamPipe) prefetch() { |
no outgoing calls
no test coverage detected