github.com/qiuhoude/go-web@v0.0.0-20220223060959-ab545e78f20d/prepare/23_proto_actor/remotewatch/node2/main.go (about) 1 package main 2 3 import ( 4 "runtime" 5 6 console "github.com/AsynkronIT/goconsole" 7 "github.com/AsynkronIT/protoactor-go/actor" 8 "github.com/AsynkronIT/protoactor-go/remote" 9 ) 10 11 func main() { 12 runtime.GOMAXPROCS(runtime.NumCPU()) 13 14 // empty actor just to have something to remote spawn 15 props := actor.PropsFromFunc(func(ctx actor.Context) {}) 16 remote.Register("remote", props) 17 18 remote.Start("127.0.0.1:8080") 19 20 console.ReadLine() 21 }