Example #1
0
func main() {
	cine.Init("127.0.0.1:9000")
	phonebook := Phonebook{cine.Actor{}, make(map[string]int)}
	pid := cine.StartActor(&phonebook)
	fmt.Println("pid:", pid)
	cine.Call(pid, (*Phonebook).Add, "Jane", 1234)
	r, _ := cine.Call(pid, (*Phonebook).Lookup, "Jane")
	fmt.Printf("Lookup('Jane') == %v\n", r[0].(int))
}
Example #2
0
func main() {
	cine.Init("127.0.0.1:8000")
	phonebook := Phonebook{cine.Actor{}, make(map[string]int)}
	pid := cine.StartActor(&phonebook)

	cine.Cast(pid, nil, (*Phonebook).Add, "Jane", 1234)
	ret, _ := cine.Call(pid, (*Phonebook).Lookup, "Jane")
	number := ret[0].(int)
	log.Infoln("number:", number)
	// Out: number: 1234
}
Example #3
0
func (p *PlayerProxy) Start(to cine.Pid) {
	cine.Call(p.Pid, (*Player).HandleStart, to)
}