concurrency

package
v0.16.8-beta1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 14, 2020 License: GPL-3.0 Imports: 0 Imported by: 0

Documentation

Overview

*****************************************************************************

*
*  Description :
*    A very basic and naive implementation of thread pool.
*
****************************************************************************

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GoRoutinePool

type GoRoutinePool struct {
	// contains filtered or unexported fields
}

func NewGoRoutinePool

func NewGoRoutinePool(numWorkers int) *GoRoutinePool

NewGoRoutinePool allocates a new thread pool with `numWorkers` goroutines.

func (*GoRoutinePool) Schedule

func (p *GoRoutinePool) Schedule(task Task)

Schedule enqueus a closure to run on the GoRoutinePool's goroutines.

func (*GoRoutinePool) Stop

func (p *GoRoutinePool) Stop()

Stop sends a stop signal to all running goroutines.

type Task

type Task func()

Task represents a work task to be run on the specified thread pool.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL