mandykoh / go-parallel

Simple parallel processing utilities for Go

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

go-parallel

PkgGoDev Go Report Card Build Status

Simple parallel processing utilities for Go.

See the API documentation for more details.

This software is made available under an MIT license.

Example usage

Split processing of a large number of things across eight workers:

var thingsToProcess []Thing

parallel.RunWorkers(8, func(workerNum, workerCount int) {
    for i := workerNum; i < len(thingsToProcess); i += workerCount {
        processThing(thingsToProcess[i])
    }
})

RunWorkers returns when all workers have run to completion, allowing a task to be performed in parallel but treated more simply as a synchronous call.

About

Simple parallel processing utilities for Go

License:MIT License


Languages

Language:Go 100.0%