示例#1
0
func spawnMultiplexer(baseCID *sarama.ContextID, output muxOutput, inputs []muxInput) *multiplexer {
	m := &multiplexer{
		contextID: baseCID.NewChild("mux"),
		inputs:    inputs,
		output:    output,
		stopCh:    make(chan none),
	}
	spawn(&m.wg, m.run)
	return m
}
示例#2
0
func newDispatcher(baseCID *sarama.ContextID, factory dispatchTierFactory, config *config.T) *dispatcher {
	d := &dispatcher{
		contextID:         baseCID.NewChild("dispatcher"),
		config:            config,
		factory:           factory,
		requestsCh:        make(chan consumeRequest, config.ChannelBufferSize),
		children:          make(map[string]*expiringDispatchTier),
		expiredChildrenCh: make(chan dispatchTier, config.ChannelBufferSize),
		stoppedChildrenCh: make(chan dispatchTier, config.ChannelBufferSize),
	}
	return d
}