processormanager

package
v0.0.0-...-5b6cbe3 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2019 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrProcessorManager is the root for the errors
	ErrProcessorManager = errors.NewClass("ProcessorManager Error")

	// ErrArg describes the family of calling errors
	ErrArg = ErrProcessorManager.NewClass("Argument error")

	// ErrRutime describes the family of system errors
	ErrRuntime = ErrProcessorManager.NewClass("Runtime error")

	// ErrInvalid is used for invalid arguments
	ErrInvalid = ErrArg.New("Invalid argument")

	// ErrNotFound indicates that the processor ask by key is not available
	ErrNotFound = ErrRuntime.New("Processor not found")

	// ErrClosed indicates the processor manager is closed
	ErrClosed = ErrRuntime.New("Processor Manager is closed")
)

Functions

This section is empty.

Types

type Config

type Config struct {
	Peer     *peer.Peer        `validate:"required"`
	Selector selector.Selector `validate:"required"`
}

Config includes the execution paramers for the ProcessorManager

type ProcessorManager

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

ProcessorManager provides clustered access to the Processors

func New

func New(config Config) (*ProcessorManager, error)

func (*ProcessorManager) Close

func (pm *ProcessorManager) Close() error

Close closes the device manager

func (*ProcessorManager) GetProcessor

func (pm *ProcessorManager) GetProcessor(processorID string) (processor.Processor, error)

GetProcessor returns a connector to the Processor identified by processorID

func (*ProcessorManager) SelectAndReserve

func (pm *ProcessorManager) SelectAndReserve(capabilities ...selector.Capability) (processor.Processor, error)

SelectAndReserve selects and reserves one of the available Processors in the cluster based on the capability contrains. It returns the Processor ID

Jump to

Keyboard shortcuts

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