pooler

package
v0.0.0-...-bebabf7 Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Operator

type Operator interface {
	Exec() error
}

Operator interface

func NewOperator

func NewOperator(f operatorFunc) Operator

NewOperator initializes a new operation based on a given work function.

type Pooler

type Pooler struct {
	sync.Mutex
	sync.Once
	// contains filtered or unexported fields
}

Pooler is a worker group that runs a number of operations at concurrency mode depended on operations count.

func NewPooler

func NewPooler(client *client.Client, log logger.Logger, ctx context.Context, cancel context.CancelFunc) *Pooler

NewPooler initializes a new pool with the given operations at the given concurrency.

func (*Pooler) Run

func (p *Pooler) Run(source string)

run all work within the pool and block until it's finished.

func (*Pooler) Scheduler

func (p *Pooler) Scheduler(ticker *time.Ticker)

Scheduler for Pooler worker

Jump to

Keyboard shortcuts

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