concise intro
Vladimir Bauer
8 years ago
| 27 | 27 | |
| 28 | 28 | ## Usage |
| 29 | 29 | |
| 30 | Following is the simplest use case: | |
| 31 | ||
| 30 | #### [Rendering single bar](examples/singleBar/main.go) | |
| 32 | 31 | ```go |
| 33 | 32 | p := mpb.New( |
| 34 | 33 | // override default (80) width |
| 67 | 66 | p.Stop() |
| 68 | 67 | ``` |
| 69 | 68 | |
| 70 | However **mpb** was designed with concurrency in mind. Each new bar renders in its | |
| 71 | own goroutine, therefore adding multiple bars is easy and safe: | |
| 72 | ||
| 69 | #### [Rendering multiple bars](examples/simple/main.go) | |
| 73 | 70 | ```go |
| 74 | 71 | var wg sync.WaitGroup |
| 75 | 72 | p := mpb.New(mpb.WithWaitGroup(&wg)) |