godep: update vmware/govmomi

This commit is contained in:
Doug MacEachern
2018-01-30 12:03:39 -08:00
parent f821a54d39
commit 5c27b98ce0
46 changed files with 2205 additions and 370 deletions

View File

@@ -18,6 +18,7 @@ package progress
import (
"container/list"
"context"
"fmt"
"io"
"sync/atomic"
@@ -75,16 +76,16 @@ type reader struct {
pos int64
size int64
bps uint64
bps uint64
ch chan<- Report
ch chan<- Report
ctx context.Context
}
func NewReader(s Sinker, r io.Reader, size int64) *reader {
func NewReader(ctx context.Context, s Sinker, r io.Reader, size int64) *reader {
pr := reader{
r: r,
r: r,
ctx: ctx,
size: size,
}
@@ -111,7 +112,10 @@ func (r *reader) Read(b []byte) (int, error) {
bps: &r.bps,
}
r.ch <- q
select {
case r.ch <- q:
case <-r.ctx.Done():
}
return n, err
}
@@ -127,8 +131,11 @@ func (r *reader) Done(err error) {
err: err,
}
r.ch <- q
close(r.ch)
select {
case r.ch <- q:
close(r.ch)
case <-r.ctx.Done():
}
}
// newBpsLoop returns a sink that monitors and stores throughput.