nsqlookup/local.go
func NewLocalEngine(config LocalConfig) *LocalEngine {
	if config.NodeTimeout == 0 {
		config.NodeTimeout = DefaultLocalEngineNodeTimeout
	}

	if config.TombstoneTimeout == 0 {
		config.TombstoneTimeout = DefaultLocalEngineTombstoneTimeout
	}

	e := &LocalEngine{
		nodeTimeout: config.NodeTimeout,
		tombTimeout: config.TombstoneTimeout,

		done: make(chan struct{}),
		join: make(chan struct{}),

		nodes: make(map[string]*LocalNode),
	}

	go e.run()
	return e
}
func NewLocalEngine(config LocalConfig) *LocalEngine {
	if config.NodeTimeout == 0 {
		config.NodeTimeout = DefaultLocalEngineNodeTimeout
	}

	if config.TombstoneTimeout == 0 {
		config.TombstoneTimeout = DefaultLocalEngineTombstoneTimeout
	}

	e := &LocalEngine{
		nodeTimeout: config.NodeTimeout,
		tombTimeout: config.TombstoneTimeout,

		done: make(chan struct{}),
		join: make(chan struct{}),

		nodes: make(map[string]*LocalNode),
	}

	go e.run()
	return e
}
// NewLocalEngine creates and returns an instance of LocalEngine configured with
// config.