Codebase list golang-github-vbauerster-mpb / c904729
make manualRefresh ater container opts are run Vladimir Bauer 3 years ago
1 changed file(s) with 11 addition(s) and 8 deletion(s). Raw diff Collapse all Expand all
6464 // method has been called.
6565 func NewWithContext(ctx context.Context, options ...ContainerOption) *Progress {
6666 s := &pState{
67 hm: make(heapManager),
68 rows: make([]io.Reader, 32),
69 refreshRate: defaultRefreshRate,
70 popPriority: math.MinInt32,
71 manualRefresh: make(chan interface{}),
72 queueBars: make(map[*Bar]*Bar),
73 output: os.Stdout,
74 debugOut: io.Discard,
67 hm: make(heapManager),
68 rows: make([]io.Reader, 32),
69 refreshRate: defaultRefreshRate,
70 popPriority: math.MinInt32,
71 queueBars: make(map[*Bar]*Bar),
72 output: os.Stdout,
73 debugOut: io.Discard,
7574 }
7675
7776 for _, opt := range options {
7877 if opt != nil {
7978 opt(s)
8079 }
80 }
81
82 if s.manualRefresh == nil {
83 s.manualRefresh = make(chan interface{})
8184 }
8285
8386 ctx, cancel := context.WithCancel(ctx)