builtin

package
v0.0.0-...-08d8efc Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2020 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrSetCallbackNil .
	ErrSetCallbackNil = errors.New("Error when set callback")

	// ErrSetSourceNil .
	ErrSetSourceNil = errors.New("Error when setting queue")
)

Functions

This section is empty.

Types

type Builtin

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

Builtin type for default worker

func CreateBuiltinWorker

func CreateBuiltinWorker(workerCount int, qq *queue.RingBuffer) (*Builtin, error)

CreateBuiltinWorker will create

func (*Builtin) Close

func (w *Builtin) Close()

Close worker and task queue with more safety make sure queue is empty, and all worker is stopped

func (*Builtin) Invoke

func (w *Builtin) Invoke(v interface{}) error

Invoke task to queue

func (*Builtin) SetCallback

func (w *Builtin) SetCallback(cb func(int, interface{})) error

SetCallback for this worker

func (*Builtin) SetSource

func (w *Builtin) SetSource(q *queue.RingBuffer) error

SetSource task for this worker

func (*Builtin) Start

func (w *Builtin) Start()

Start or spawn every single worker to listen to the same queue

func (*Builtin) WorkerCount

func (w *Builtin) WorkerCount() int

WorkerCount of current worker var

Jump to

Keyboard shortcuts

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