Documentation
¶
Overview ¶
Package g is a goroutine life cycle management package.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type G ¶
type G struct {
// contains filtered or unexported fields
}
G is a goroutine
func (*G) Cancel ¶
Cancel cancels the goroutine. Note that the goroutine does not get stopped and a good practice is to use Cancel with WithUndo function:
g := g.Go(func() error { ... }).WithUndo(func() { ... }) ... err := g.Cancel().Wait().Err() if err != nil { ... }
Then the settled undo function will be executed after the cancellation.
Click to show internal directories.
Click to hide internal directories.