Skip to content

Latest commit

 

History

History
19 lines (15 loc) · 333 Bytes

README.md

File metadata and controls

19 lines (15 loc) · 333 Bytes

gwait

A simple utility to de-duplicate the job of waiting for goroutines to close

	w := gwait.NewWaiter()

	// Run function in a goroutine
	w.Go(func() {
		// do something
	})

	// Run another function in a goroutine
	w.Go(func() {
		// do something else
	})

	// Ensure we wait for the goroutines to complete
	w.Wait()