routine

package
v1.3.1 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Recover

func Recover(f func(context.Context, interface{})) func(*option)

Recover register to Pool

Types

type ErrGroup added in v1.2.0

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

func NewGroup

func NewGroup(ctx context.Context) *ErrGroup

NewGroup starts a recoverable goroutine ErrGroup with a context.

func (*ErrGroup) Go added in v1.2.0

func (e *ErrGroup) Go(goroutine func(context.Context) error)

Go starts a recoverable goroutine with a context.

func (*ErrGroup) Wait added in v1.2.0

func (e *ErrGroup) Wait() error

type Pool added in v1.2.0

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

func NewPool

func NewPool(parentCtx context.Context, opts ...func(*option)) *Pool

NewPool creates a Pool.

func (*Pool) Go added in v1.2.0

func (p *Pool) Go(goroutine func(context.Context))

Go starts a recoverable goroutine with a context.

func (*Pool) Stop added in v1.2.0

func (p *Pool) Stop()

Stop stops all started routines, waiting for their termination.

func (*Pool) Wait added in v1.2.0

func (p *Pool) Wait()

Wait waits 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