Skip to content

icambridge/cartel

Repository files navigation

Cartel

Build StatusCoverage Status

A task process pool to allow for the easy creation of a pool of workers.

Installation

The recommended way to install go-dependency

    get github.com/icambridge/cartel

Examples

How import the package

import (
    "github.com/icambridge/cartel"
)

Create your own Task

type MockTask struct {
    Name string
}

func (mt MockTask) Execute() interface{} {
    return MockOutput{mt.Name}
}

Then to use

p := cartel.NewPool(cartel.PoolOptions{Size: 1})

task := MockTask{"Iain"}

p.Do(task)
p.End()
value := <-p.Output

About

A simple worker process pool in go

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages