sieve

package
v0.0.0-...-62f53a0 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2020 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 Consumer

type Consumer interface {
	Start(context.Context)
	Done() <-chan struct{}
	Error() error
}

func New

func New(producer Producer, progress chan<- Progress) (Consumer, error)

type Producer

type Producer interface {
	// Produce must return Task interface or nil if does not have more tasks
	Start(context.Context) <-chan Task
	// Count return how many tasks will producer make
	Count() int
	// Close serves as cleanup function a returns error if it has any
	Close() error
}

type Progress

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

func (*Progress) Absolute

func (p *Progress) Absolute() (actual, total int)

func (*Progress) Relative

func (p *Progress) Relative() float64

type Task

type Task interface {
	Run() error
	Cancel()
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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