Created
April 10, 2020 18:28
-
-
Save obcode/ee7cd09f4eb6acc5abd2309676cd2c22 to your computer and use it in GitHub Desktop.
Main für Customer-Service customer/service/main.go
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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