コード例 #1
0
ファイル: master.go プロジェクト: mervin0502/SalonRabbit
//New
func New() *Master {
	w := new(Master)
	msgs := message.NewLocalMessageContainer()
	sc := com.NewSignalChannel(w)

	w.NodeIndexMap = make(map[string]*engine.ObjectIndex, 100)
	w.MessageContainer = msgs
	w.DataChan = com.NewDataChannel(w)
	w.SignalChan = sc
	w.superstep = NewSuperstep(sc)
	return w
}
コード例 #2
0
ファイル: slave.go プロジェクト: mervin0502/SalonRabbit
func New() *Slave {
	w := new(Slave)
	msgs := message.NewLocalMessageContainer()
	//DataChannel Structure Router, call relationship
	sc := com.NewSignalChannel(w)
	dc := com.NewDataChannel(w)
	net := structure.New(dc)
	r := NewRouter(net, msgs)
	w.Net = net
	w.MessageContainer = msgs
	w.DataChan = dc
	w.SignalChan = sc

	w.Router = r
	w.processor = NewProcessor(net, sc)
	w.localNet = &InitLocalNet{r}
	println(w.Router)
	return w
}