workers

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2020 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Internal package. Package realizes the IManager interface.

Internal package. Package realizes the IWorker interface.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewManager

func NewManager(name faces.Name, typ faces.ManagerType, lengthChannel, minCount, maxCount int, tr faces.ITrace) faces.IManager

func NewWorker

func NewWorker(id string, name faces.Name, in, out, errCh faces.IChan, giveBirth faces.GiveBirth,
	wg *sync.WaitGroup, tr faces.ITrace, activeWorkers *int32) (faces.IWorker, error)

Types

type Manager

type Manager struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func (*Manager) GetNextManager

func (m *Manager) GetNextManager() faces.IManager

func (*Manager) GetPrevManager

func (m *Manager) GetPrevManager() faces.IManager

func (*Manager) IsLast

func (m *Manager) IsLast() bool

func (*Manager) MetricPeriod

func (m *Manager) MetricPeriod(duration time.Duration) faces.IManager

The period between metric evaluations. By default 10 second

func (*Manager) SetChanErr

func (m *Manager) SetChanErr(errCh faces.IChan) faces.IManager

func (*Manager) SetChanIn

func (m *Manager) SetChanIn(in faces.IChan) faces.IManager

func (*Manager) SetChanOut

func (m *Manager) SetChanOut(out faces.IChan) faces.IManager

func (*Manager) SetHandler

func (m *Manager) SetHandler(handler faces.GiveBirth) faces.IManager

func (*Manager) SetIsLast

func (m *Manager) SetIsLast(isLast bool) faces.IManager

func (*Manager) SetNextManager

func (m *Manager) SetNextManager(next faces.IManager) faces.IManager

func (*Manager) SetPrevManager

func (m *Manager) SetPrevManager(previous faces.IManager) faces.IManager

func (*Manager) SetWaitGroup

func (m *Manager) SetWaitGroup(wg *sync.WaitGroup) faces.IManager

func (*Manager) SetWorkersCounter

func (m *Manager) SetWorkersCounter(wc faces.IWorkersCounter) faces.IManager

func (*Manager) Start

func (m *Manager) Start(ctx context.Context) error

func (*Manager) Statistic

func (m *Manager) Statistic() *nodes.ManagerData

func (*Manager) Stop

func (m *Manager) Stop()

type Worker

type Worker struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func (*Worker) ID

func (w *Worker) ID() string

func (*Worker) IsLast

func (w *Worker) IsLast() bool

func (*Worker) Name

func (w *Worker) Name() faces.Name

func (*Worker) SetBorderCond

func (w *Worker) SetBorderCond(typ faces.ManagerType, isLast bool)

func (*Worker) Start

func (w *Worker) Start(ctx context.Context) error

func (*Worker) Stop

func (w *Worker) Stop()

Jump to

Keyboard shortcuts

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