parallel

package module
v0.0.0-...-54c9f59 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2022 License: MIT Imports: 5 Imported by: 0

README

Go

Overview

Parallel task management with error management.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Parallel

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

func New

func New() *Parallel

func (*Parallel) Cancel

func (parallel *Parallel) Cancel(err error)

func (*Parallel) OnData

func (parallel *Parallel) OnData(listener func(task Task)) *Parallel

func (*Parallel) OnETA

func (parallel *Parallel) OnETA(listener func(current int, total int, eta time.Duration)) *Parallel

func (*Parallel) OnFinish

func (parallel *Parallel) OnFinish(listener func()) *Parallel

func (*Parallel) Run

func (parallel *Parallel) Run(data interface{}, concurrency int) (err error)

type Task

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

func (*Task) Cancel

func (p *Task) Cancel(err error)

func (*Task) Data

func (p *Task) Data() interface{}

func (*Task) ETA

func (p *Task) ETA() time.Duration

func (*Task) Finish

func (p *Task) Finish()

func (*Task) Index

func (p *Task) Index() int

func (*Task) Total

func (p *Task) Total() int

Jump to

Keyboard shortcuts

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