package task

// CancelCondition is a condition for canceling the task group.
type CancelCondition func(err error) (cancel bool)

// CancelOnError indicates that task group should return on non-nil error. This
// is the same behavior as the golang.org/x/sync/errgroup package.
func () CancelCondition {
	return cancelOnError
}

func ( error) ( bool) {
	return  != nil
}

// CancelOnReturn indicates that task group should be canceled if any
// subtask returns.
func () CancelCondition {
	return cancelOnReturn
}

func ( error) ( bool) {
	return true
}

// NeverCancel indicates that task group should not be canceled until
// all subtasks complete.
func () CancelCondition {
	return neverCancel
}

func ( error) ( bool) {
	return false
}