worker

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2022 License: LGPL-3.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrFull   = errors.New("worker queue is full, make it larger in the config")
	ErrClosed = errors.New("async handlers are closed")
)

Functions

func IsErrFull

func IsErrFull(err error) bool

Types

type IMsg

type IMsg interface {
	ID() uint64
	Headers() map[string]string
	Body() string
}

type IWorkerPool

type IWorkerPool interface {
	TryPut(task IMsg) error
	Start()
	Stop()
	AddHandler(msgType string, handler MsgHandler)
	DelHandler(msgType string)
	QueueLen() int
}

type MsgHandler

type MsgHandler = func(msg IMsg) error

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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