Skip to content

Waiter is a simple golang library that provides a terminal progress bar around a sync.WaitGroup

Notifications You must be signed in to change notification settings

gen0cide/waiter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

Waiter

Simple library that marries sync.WaitGroup with a uiprogress.Bar for easily configurable progress of concurrent work.

Installation

go get github.com/gen0cide/waiter

Usage

// Create your Waiter
wg := waiter.New()

count := 10 // example num of workers

// populate with work
for i := 0; i < count; i++ {
  // increase your waiter
  wg.Add(1)

  // start the workers
  go func(id int) {
    time.Sleep(time.Duration(id) * time.Second)
    wg.Done()
  }(i)
}

// block on the work finishing
// and render the UI as we wait for it to complete
wg.Wait(true)

// That's it!

About

Waiter is a simple golang library that provides a terminal progress bar around a sync.WaitGroup

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages