Skip to content
/ async Public

A collection of methods for running functions concurrently.

License

Notifications You must be signed in to change notification settings

eleniums/async

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

72 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

async

Go Report Card GoDoc License: MIT

A collection of methods for running functions concurrently.

Installation

go get -u github.com/eleniums/async/v2

NOTE: async/v2 is currently identical to async as of 6/12/20. When this repo was originally converted to Go Modules, it had already been tagged as v2.x.x due to previous breaking changes. At the time, there were some issues converting a repo with major version 2+ to Go Modules without the /v2 path. As such, the /v2 path was created to follow convention. Going forward, any changes will be made in the /v2 path, so only /v2 should be used.

Example

Create some tasks to run:

foo := func() error {
    // do something
    return nil
}

bar := func() error {
    // do something else
    return nil
}

Run the tasks concurrently:

errc := async.Run(foo, bar)
err := async.Wait(errc)
if err != nil {
    log.Fatalf("task returned an error: %v", err)
}

About

A collection of methods for running functions concurrently.

Resources

License

Stars

Watchers

Forks

Packages

No packages published