Skip to content

Commit

Permalink
fixed remote example (#119)
Browse files Browse the repository at this point in the history
  • Loading branch information
anthdm authored Dec 20, 2023
1 parent 9d77c10 commit 1855d07
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions examples/remote/client/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,11 @@ func main() {
panic(err)
}

pid := actor.NewPID("127.0.0.1:4000", "server")
// The server will be started with id "myserverid". Hence, let's create
// the correct PID for it so its reachable.
serverPID := actor.NewPID("127.0.0.1:4000", "server/myserverid")
for {
e.Send(pid, &msg.Message{Data: "hello!"})
e.Send(serverPID, &msg.Message{Data: "hello!"})
time.Sleep(time.Second)
}
}
2 changes: 1 addition & 1 deletion examples/remote/server/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,6 @@ func main() {
panic(err)
}

e.Spawn(newServer, "server")
e.Spawn(newServer, "server", actor.WithID("myserverid"))
select {}
}

0 comments on commit 1855d07

Please sign in to comment.