First commit

This commit is contained in:
Jae Kwon
2015-10-21 12:15:19 -07:00
commit 16372365c4
21 changed files with 1850 additions and 0 deletions

15
async.go Normal file
View File

@ -0,0 +1,15 @@
package common
import "sync"
func Parallel(tasks ...func()) {
var wg sync.WaitGroup
wg.Add(len(tasks))
for _, task := range tasks {
go func(task func()) {
task()
wg.Done()
}(task)
}
wg.Wait()
}