pool

package
v0.0.0-...-25a2715 Latest Latest
Warning

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

Go to latest
Published: Oct 21, 2019 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RoutingPoolWithAutomatic

func RoutingPoolWithAutomatic(worker func(context.CancelFunc), max int) (context.CancelFunc, chan struct{})

RoutingPoolWithAutomatic defined routing pool for work Example i := 0

_, done := pool.RoutingPoolWithAutomatic(func(cancel context.CancelFunc) {
	time.Sleep(10 * time.Second)
	i++
	if i == 30 {
		cancel()
	}
}, 10)

<-done

func RoutingPoolWithTimer

func RoutingPoolWithTimer(worker func(context.CancelFunc), max int) (context.CancelFunc, chan struct{})

RoutingPoolWithTimer defined routing pool for work Example i := 0

_, done := pool.RoutingPoolWithTimer(func(cancel context.CancelFunc) {
	time.Sleep(10 * time.Second)
	i++
	if i == 30 {
		cancel()
	}
}, 10)

<-done

Types

This section is empty.

Jump to

Keyboard shortcuts

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