/async

A collection of methods for running functions concurrently.

Primary LanguageGoMIT LicenseMIT

async

Build Status Go Report Card GoDoc License: MIT

A collection of methods for running functions concurrently.

Installation

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

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)
}