poller

package
v0.0.0-...-c02b23a Latest Latest
Warning

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

Go to latest
Published: Nov 9, 2020 License: MIT Imports: 29 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ContextName      = "NAME"
	MessageCache int = 10000
	NumWorkers       = 10
)

Variables

View Source
var (
	DistributedLock *lock.Client
)

Functions

This section is empty.

Types

type Poller

type Poller struct {
	ID      string `json:"id" toml:"id" yaml:"id"`
	Name    string `json:"name" toml:"name" yaml:"name"`
	Address string `json:"address" toml:"address" yaml:"address"`
	// contains filtered or unexported fields
}

func New

func New(config *config.Configuration, logger hclog.Logger) *Poller

New creates a new main poller instance

func (*Poller) Run

func (a *Poller) Run() error

Run starts the poller work pool

func (*Poller) UnmarshalText

func (a *Poller) UnmarshalText(text []byte) error

type Pool

type Pool []*Worker

func (Pool) Len

func (p Pool) Len() int

func (Pool) Less

func (p Pool) Less(i, j int) bool

func (*Pool) Pop

func (p *Pool) Pop() interface{}

func (*Pool) Push

func (p *Pool) Push(x interface{})

func (*Pool) Swap

func (p *Pool) Swap(i, j int)

type Worker

type Worker struct {
	Id       int    `json:"id"`
	Name     string `json:"name"`
	Pending  int    `json:"pending"`
	Executed int    `json:"executed"`
	// contains filtered or unexported fields
}

type WorkerPool

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

func NewWorkerPool

func NewWorkerPool(nWorker int, nRequester int, logger hclog.Logger) *WorkerPool

func (*WorkerPool) Balance

func (b *WorkerPool) Balance(j chan *transport.Message)

Jump to

Keyboard shortcuts

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