Skip to content

Instantly share code, notes, and snippets.

@obcode
Created April 10, 2020 18:28
Show Gist options
  • Save obcode/ee7cd09f4eb6acc5abd2309676cd2c22 to your computer and use it in GitHub Desktop.
Save obcode/ee7cd09f4eb6acc5abd2309676cd2c22 to your computer and use it in GitHub Desktop.
Main für Customer-Service customer/service/main.go
func main() {
var wg sync.WaitGroup
wg.Add(1)
defer wg.Wait()
flagBind := flag.String("bind", ":9010", "Bind service to address")
flag.Parse()
context := actor.EmptyRootContext
props := actor.PropsFromProducer(customer.NewService)
pid := context.Spawn(props)
remote.Start(*flagBind)
remote.Register("customer", actor.PropsFromFunc(func(ctx actor.Context) {
ctx.RequestWithCustomSender(pid, ctx.Message(), ctx.Sender())
}))
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment