MCPcopy
hub / github.com/NVIDIA/aistore / wrapReader

Method wrapReader

downloader/task.go:196–208  ·  view source on GitHub ↗
(ctx context.Context, r io.ReadCloser)

Source from the content-addressed store, hash-verified

194}
195
196func (t *singleObjectTask) wrapReader(ctx context.Context, r io.ReadCloser) io.ReadCloser {
197 // Create a custom reader to monitor progress every time we read from response body stream.
198 r = &progressReader{
199 r: r,
200 reporter: func(n int64) {
201 t.currentSize.Add(n)
202 nl.OnProgress(t.job.Notif())
203 },
204 }
205 // Wrap around throttler reader (noop if throttling is disabled).
206 r = t.job.throttler().wrapReader(ctx, r)
207 return r
208}
209
210func (t *singleObjectTask) setTotalSize(size int64) {
211 if size > 0 {

Callers 2

tryDownloadLocalMethod · 0.95
downloadRemoteMethod · 0.95

Calls 4

OnProgressFunction · 0.92
AddMethod · 0.65
NotifMethod · 0.65
throttlerMethod · 0.65

Tested by

no test coverage detected