func (cs *ChildSpec) Dispose() {
	cs.disposalCh <- cs.key
}
Dispose is a function that should be called when all child operation
goroutine are stopped and it is ready to be garbage collected.
package dispatcher
import (
	"time"
	"github.com/mailgun/kafka-pixy/actor"
	"github.com/mailgun/kafka-pixy/config"
	"github.com/mailgun/kafka-pixy/consumer"
	"github.com/mailgun/kafka-pixy/none"
	"github.com/pkg/errors"
)
var (
	rsTooManyRequests = consumer.Response{Err: consumer.ErrTooManyRequests}
	rsUnavailable     = consumer.Response{Err: consumer.ErrUnavailable}
)
type T struct {
	actDesc    *actor.Descriptor
	cfg        *config.Proxy
	factory    Factory
	requestsCh chan consumer.Request
	childSpec  *ChildSpec
	finalizer  func()
	children   map[Key]chan consumer.Request
	disposalCh chan Key
	stoppedCh  chan none.T
}
type Key string
type Factory interface {
	KeyOf(rq consumer.Request) Key
	SpawnChild(childSpec ChildSpec)
}
type ChildSpec struct {
	key        Key
	requestsCh chan consumer.Request
	disposalCh chan<- Key
}
func NewChildSpec4Test(requests chan consumer.Request) ChildSpec {
	return ChildSpec{
		key:        "test",
		requestsCh: requests,
		disposalCh: make(chan Key),
	}
}
func (cs *ChildSpec) Key() Key {
	return cs.key
}
func (cs *ChildSpec) Requests() <-chan consumer.Request {
	return cs.requestsCh
}