Documentation
¶
Overview ¶
Package concurrent provides concurrent primitives/shortcuts.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Group ¶
type Group struct {
// contains filtered or unexported fields
}
Group is a Close-able thread group.
func NewGroup ¶
NewGroup initializes a new Close-able thread group.
Usage:
threads := concurrent.NewGroup(ctx)
threads.Go(func() {
<-threads.Done() // "subscribe" for cancellation
...
})
err := threads.Close() // may be defer-ed etc - blocks till all threads terminate
Click to show internal directories.
Click to hide internal directories.