safe

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2021 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Go

func Go(goroutine func())

func GoWithRecover

func GoWithRecover(goroutine func(), customRecover func(err interface{}))

GoWithRecover starts a recoverable goroutine using given customRecover() function.

Types

type Pool

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

Pool is a pool of go routines.

func NewPool

func NewPool(parentCtx context.Context) *Pool

NewPool creates a Pool.

func (*Pool) Go

func (p *Pool) Go(goroutine routineCtx)

Go starts a recoverable goroutine with a context.

func (*Pool) GoCtx

func (p *Pool) GoCtx(goroutine routineCtx)

GoCtx starts a recoverable goroutine with a context.

func (*Pool) Stop

func (p *Pool) Stop()

Stop stops all started routines, waiting for their termination.

Jump to

Keyboard shortcuts

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