Beispiel #1
0
//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
}
Beispiel #2
0
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
}