func (e *Executor) Stop() {
	for _, cb := range e.cb {
		cb.stop()
	}
}
Stop sends a signal to all callbacks to exit and returns. This unblocks
"Run()" but does not block itself.
package exec  
import (
	"context"
	"log"
	"os"
	"strconv"
	"sync"
	"time"
	"collectd.org/api"
	"collectd.org/format"
)
var Putval api.Writer = format.NewPutval(os.Stdout)
type callback interface {
	run(context.Context, *sync.WaitGroup)
	stop()
}
type Executor struct {
	cb    []callback
	group sync.WaitGroup
}
func NewExecutor() *Executor {
	return &Executor{
		group: sync.WaitGroup{},
	}
}
func (e *Executor) ValueCallback(callback func() api.Value, vl *api.ValueList) {
	e.cb = append(e.cb, &valueCallback{
		callback: callback,
		vl:       *vl,
		done:     make(chan struct{}),
	})
}
func (e *Executor) VoidCallback(callback func(context.Context, time.Duration), interval time.Duration) {
	e.cb = append(e.cb, voidCallback{
		callback: callback,
		interval: interval,
		done:     make(chan struct{}),
	})
}
func (e *Executor) Run(ctx context.Context) {
	for _, cb := range e.cb {
		e.group.Add(1)
		go cb.run(ctx, &e.group)
	}
	e.group.Wait()
}