Categorygithub.com/echaouchna/go-threadpool
modulepackage
0.0.0-20200710091445-40e825e02c8e
Repository: https://github.com/echaouchna/go-threadpool.git
Documentation: pkg.go.dev

# README

go-threadpool

# Functions

RunWorkers create and run jobs * queue channel of Action type, jobs will listen to this queue * jobFunctions containing the jobFunc to be used by the jobs and the action nmaes used to select one of these functions * workersNumber the number of jobs - if workersNumber <= 0 or workersNumber > 2*cpuCount ==> runtime.NumCPU() will be used - otherwise workersNumber will be used.

# Constants

Paused means all jobs are paused.
Running means all jobs are running.
Stopped means all jobs are stopped.

# Variables

AllStatus is a constant exposing all possible Status.

# Structs

Action data used by the jobs * Name the type of action, should match a name of a function in the jobFunctions map will used to select the function to run Data the data to pass to the jobFunc.
Handler is an object used to control the threadpool.

# Type aliases

JobFunc the function type to be run by the jobs.
Status type.