tpool

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 15, 2018 License: MIT Imports: 4 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	COUNT_BITS = 29
	CAPACITY   = (1 << COUNT_BITS) - 1
)
View Source
const (
	RUNNING = (iota - 1) << COUNT_BITS
	SHUTDOWN
	STOP
	TIDYING
	TERMINATED
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Command

type Command func() error

type Future

type Future struct {
}

type PoolExecutor

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

func (*PoolExecutor) Execute

func (p *PoolExecutor) Execute(command Command) error

type Queue

type Queue interface {
	Offer(interface{}) bool
	Remove(interface{}) bool
	IsEmpty() bool
}

type Task

type Task func() Future

type Worker

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

func (*Worker) Close

func (w *Worker) Close()

func (*Worker) Put

func (w *Worker) Put(c Command)

func (*Worker) Start

func (w *Worker) Start()

Jump to

Keyboard shortcuts

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