ordergroup

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2020 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option struct {
	AutoWait bool
}

type OrderGroup

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

OrderGroup ensures a set of async tasks are performed in scheduled order.

func New

func New(n int, opt Option) *OrderGroup

New creates an OrderGroup of given size.

func (*OrderGroup) DoRank

func (g *OrderGroup) DoRank(i int, f Task)

DoRank starts the i-th (0 <= i < n) rank.

func (*OrderGroup) Start

func (g *OrderGroup) Start()

func (*OrderGroup) Stop

func (g *OrderGroup) Stop()

func (*OrderGroup) Wait

func (g *OrderGroup) Wait() []int

type Task

type Task func()

Jump to

Keyboard shortcuts

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