player

package
v0.0.0-...-baa17e1 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(path, mask string, replayer Player, nConsumers int)

Run starts replaying files from given path that satisfy mask with nConsumers goroutines.

Types

type Consumer

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

Consumer consumes a batch of files to process then concurrently.

func NewConsumer

func NewConsumer(l *chan string, j chan string, r Player) *Consumer

NewConsumer creates instance of Consumer with given parameters.

func (*Consumer) Consume

func (c *Consumer) Consume(ctx context.Context)

Consume consumes workload and pushes for workers.

func (*Consumer) Work

func (c *Consumer) Work(wg *sync.WaitGroup)

Work does work.

type Player

type Player interface {
	Play(filename string) error
}

Player is interface to replay original data from provided filename.

type Producer

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

Producer producing work for parser from a list of xml files in given path.

func NewProducer

func NewProducer(path, fileMask string, l *chan string, q chan interface{}) *Producer

NewProducer creates of Producer instance.

func (*Producer) Produce

func (p *Producer) Produce()

Produce sends filenames to consumer to parse files concurently.

Jump to

Keyboard shortcuts

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