This section is empty.


This section is empty.


This section is empty.


type Group

type Group struct {
	// contains filtered or unexported fields

    Group is a group of tasks which should each be executed concurrently, and which should be collectively blocked on until all are complete. Tasks should be preemptable, and the first task to return a non-nil error cancels the entire Group. While Group is used to invoke and wait on multiple goroutines, it is not itself thread-safe.

    func NewGroup

    func NewGroup(ctx context.Context) *Group

      NewGroup returns a new, empty Group with the given Context.

      func (*Group) Cancel

      func (g *Group) Cancel()

        Cancel the Group Context.

        func (*Group) Context

        func (g *Group) Context() context.Context

          Context returns the Group Context.

          func (*Group) GoRun

          func (g *Group) GoRun()

            GoRun all queued functions. GoRun may be called only once: the second invocation will panic.

            func (*Group) Queue

            func (g *Group) Queue(desc string, fn func() error)

              Queue a function for execution with the Group. Cannot be called after GoRun is invoked or Queue panics.

              func (*Group) Wait

              func (g *Group) Wait() error

                Wait for started functions, returning only after all complete. The first encountered non-nil error is returned. GoRun must have been called or Wait panics.

                Source Files