g0

package
v0.4.24 Latest Latest
Warning

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

Go to latest
Published: May 4, 2022 License: ISC Imports: 12 Imported by: 1

Documentation

Overview

Package g0 facilitates launch, management and execution of goroutines

Index

Constants

This section is empty.

Variables

View Source
var GoGroupFactory parl.GoGroupFactory = &goGroupFactory{}
View Source
var GoerFactory parl.GoerFactory = &goerFactory{}
View Source
var Index goerIndex

Functions

func NewGo

func NewGo(
	errorReceiver func(err error),
	add func(delta int),
	done func(err *error),
	context func() (ctx context.Context),
	cancel func()) (g0 parl.Go)

func NewGoError

func NewGoError(err error, source parl.GoErrorSource, goer parl.Goer) (goError parl.GoError)

func NewGoGroup added in v0.4.19

func NewGoGroup(ctx context.Context) (goCreator parl.GoGroup)

func NewGoSub added in v0.4.15

func NewGoSub(g0 parl.Go) (subGo parl.SubGo)

func NewGoer

func NewGoer(
	conduit parl.ErrorConduit,
	exitAction parl.ExitAction,
	index parl.GoIndex,
	gc *GoGroup,
	parentID parl.ThreadID,
	addLocation *pruntime.CodeLocation) (goer parl.Goer)

func NewGoerGroup added in v0.4.19

func NewGoerGroup(ctx context.Context) (goer parl.Goer)

Types

type Go added in v0.4.21

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

func (*Go) Add added in v0.4.21

func (g0 *Go) Add(delta int)

func (*Go) AddError added in v0.4.21

func (g0 *Go) AddError(err error)

func (*Go) Cancel added in v0.4.21

func (g0 *Go) Cancel()

func (*Go) Context added in v0.4.21

func (g0 *Go) Context() (ctx context.Context)

func (*Go) Done added in v0.4.21

func (g0 *Go) Done(errp *error)

func (*Go) Register added in v0.4.21

func (g0 *Go) Register()

func (*Go) SubGo added in v0.4.21

func (g0 *Go) SubGo() (goCancel parl.SubGo)

type GoErrorDo

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

func (*GoErrorDo) GetError

func (ge *GoErrorDo) GetError() (err error)

func (*GoErrorDo) Goer

func (ge *GoErrorDo) Goer() (goer parl.Goer)

func (*GoErrorDo) Source

func (ge *GoErrorDo) Source() (source parl.GoErrorSource)

func (*GoErrorDo) String added in v0.4.17

func (ge *GoErrorDo) String() (s string)

type GoGroup added in v0.4.19

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

func (*GoGroup) Add added in v0.4.19

func (gc *GoGroup) Add(conduit parl.ErrorConduit, exitAction parl.ExitAction) (goer parl.Goer)

func (*GoGroup) Ch added in v0.4.20

func (we *GoGroup) Ch() (ch <-chan parl.GoError)

func (*GoGroup) IsExit added in v0.4.19

func (we *GoGroup) IsExit() (isExit bool)

func (*GoGroup) String added in v0.4.20

func (gc *GoGroup) String() (s string)

func (*GoGroup) Wait added in v0.4.19

func (we *GoGroup) Wait()

func (*GoGroup) WaitPeriod added in v0.4.19

func (gc *GoGroup) WaitPeriod(duration ...time.Duration)

type Goer added in v0.4.21

type Goer struct {
	GoerGroup // Ch() IsExit() Wait() Cancel() Context()
	// contains filtered or unexported fields
}

func (*Goer) AddError added in v0.4.21

func (gr *Goer) AddError(err error)

func (*Goer) Ch added in v0.4.21

func (we *Goer) Ch() (ch <-chan parl.GoError)

func (*Goer) Go added in v0.4.21

func (gr *Goer) Go() (g0 parl.Go)

func (*Goer) IsExit added in v0.4.21

func (we *Goer) IsExit() (isExit bool)

func (*Goer) String added in v0.4.21

func (gr *Goer) String() (s string)

String outputs: #[index] [waitcount]([adds]): —lines: #[Goer-index] [waitcount]([adds]) ID: [thread-ID or parent-thread-ID] [create location].

index is a main-invocation-unique numeric identifier for the Goer. waitcount is the oustanding number of done invocations for the Goer. adds is the number of adds invoked for the Goer.

func (*Goer) Wait added in v0.4.21

func (we *Goer) Wait()

type GoerGroup added in v0.4.19

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

func (*GoerGroup) AddError added in v0.4.19

func (gr *GoerGroup) AddError(err error)

func (*GoerGroup) Ch added in v0.4.19

func (we *GoerGroup) Ch() (ch <-chan parl.GoError)

func (*GoerGroup) Go added in v0.4.19

func (gr *GoerGroup) Go() (g0 parl.Go)

func (*GoerGroup) IsExit added in v0.4.19

func (we *GoerGroup) IsExit() (isExit bool)

func (*GoerGroup) String added in v0.4.19

func (we *GoerGroup) String() (s string)

func (*GoerGroup) Wait added in v0.4.19

func (we *GoerGroup) Wait()

type SubGo added in v0.4.21

type SubGo struct {
	parl.Go // Register() AddError()
	// contains filtered or unexported fields
}

func (*SubGo) Add added in v0.4.21

func (gc *SubGo) Add(delta int)

func (*SubGo) Done added in v0.4.21

func (gc *SubGo) Done(errp *error)

func (*SubGo) SubGo added in v0.4.21

func (gc *SubGo) SubGo() (goCancel parl.SubGo)

Jump to

Keyboard shortcuts

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