pool

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Jul 4, 2020 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrorPoolClosed           = errors.New("pool closed")
	ErrorPoolIllegalSize      = errors.New("wrong size")
	ErrorWorkerExpiryDuration = errors.New("invalid expiry duration")
)

Functions

This section is empty.

Types

type ConsumeErrorHandler

type ConsumeErrorHandler func(string, error)

type Pool

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

func NewPool

func NewPool(size int, expiry int, errHandle func(string, error)) (*Pool, error)

func (*Pool) Release

func (p *Pool) Release() error

func (*Pool) Submit

func (p *Pool) Submit(task *Task) error

type Task

type Task struct {
	Msg        string
	HandleChan chan string
	Handle     func(string) error
}

type Worker

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

Jump to

Keyboard shortcuts

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