Skip to content
/ async Public

do async jobs concurently and return results with order

Notifications You must be signed in to change notification settings

bowin/async

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

do async jobs concurently and return results with order

Install

go get github.com/bowin/async

Usage

package main
import "time"
import "github.com/bowin/async"
func main()
	f1 := func()interface{} {
		return "hell1"
	}
	f2 := func()interface{} {
		time.Sleep(time.Second)
		return "hell2"
	}
	f3 := func()interface{} {
		time.Sleep(time.Millisecond * 10)
		return "hell3"
	}
    r, _ := async.DoJobs(f1, f2, f3)
    // r will be array like {"hell1", "hell2", "hell3"}
}    

About

do async jobs concurently and return results with order

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages