state

package
v0.0.0-...-b631e0d Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2018 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Add values
	Add op = "add"
	// Subtract values
	Subtract = "sub"
	// Multiply values
	Multiply = "mult"
	// Divide values
	Divide = "div"
)

Variables

This section is empty.

Functions

func Processor

func Processor(ctx context.Context, in chan *WorkRequest, out chan *WorkResponse)

Processor routes work to Process

Types

type WorkRequest

type WorkRequest struct {
	Operation op
	Value1    int64
	Value2    int64
}

WorkRequest perform an op on two values

type WorkResponse

type WorkResponse struct {
	Wr     *WorkRequest
	Result int64
	Err    error
}

WorkResponse returns the result and any errors

func Process

func Process(wr *WorkRequest) *WorkResponse

Process switches on operation type Then does work

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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