NewWorker creates a new worker for running tasks in parallel.
The max parameter specifies the maximum number of goroutines that can run at the same time.
Example:
w := coroutines.NewWorker(10)
defer w.Close()
w.Push(func() {
// do something
}...)
w.Wait()