worker

package
v0.0.0-...-433885b Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2021 License: Apache-2.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Dispatcher

type Dispatcher interface {
	// called by client
	Send(in interface{}) (interface{}, error)
	// called by worker to get more work
	Dispatch() Request
	// associate worker with dispatcher and start working
	AddWorker(worker Worker)
	Close()
}

Dispatcher ...

func NewDispatcher

func NewDispatcher(size int) Dispatcher

NewDispatcher ...

type Request

type Request struct {
	In     interface{}
	Result (chan interface{})
	Err    (chan error)
}

Request ...

type Worker

type Worker interface {
	SetDispatcher(d Dispatcher)
	Loop()
}

Worker ...

Jump to

Keyboard shortcuts

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