Skip to content

Commit b92b3b7

Browse files
authored
Merge pull request #1048 from asynkron/fix-examples
Fix examples
2 parents 98b5bb6 + 22c10dc commit b92b3b7

File tree

49 files changed

+1530
-60
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+1530
-60
lines changed

cluster/cluster.pb.go

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cluster/cluster_test_tool/pubsub_cluster.pb.go

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cluster/gossip.pb.go

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cluster/grain.pb.go

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cluster/pubsub.pb.go

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cluster/pubsub_test.pb.go

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/cluster-basic/node1/main.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
package main
22

33
import (
4+
"cluster-basic/shared"
45
"fmt"
5-
66
console "github.com/asynkron/goconsole"
77
"github.com/asynkron/protoactor-go/actor"
88
"github.com/asynkron/protoactor-go/cluster"
@@ -18,7 +18,7 @@ func main() {
1818
console.ReadLine()
1919
pid := c.Get("abc", "hello")
2020
fmt.Printf("Got pid %v", pid)
21-
res, _ := c.Request("abc", "hello", &actor.Touch{})
21+
res, _ := c.Request("abc", "hello", &shared.HelloRequest{Name: "Roger"})
2222
fmt.Printf("Got response %v", res)
2323

2424
fmt.Println()

examples/cluster-basic/node2/main.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,9 @@ func startNode() *cluster.Cluster {
3333
switch msg := ctx.Message().(type) {
3434
case *actor.Started:
3535
fmt.Printf("Started %v", msg)
36-
case *shared.Hello:
36+
case *shared.HelloRequest:
3737
fmt.Printf("Hello %v\n", msg.Name)
38+
ctx.Respond(&shared.HelloResponse{})
3839
}
3940
})
4041
helloKind := cluster.NewKind("hello", props)

examples/cluster-basic/shared/protos.pb.go

+74-21
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/cluster-basic/shared/protos.proto

+5-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@ syntax = "proto3";
22
package shared;
33
option go_package = "github.com/asynkron/protoactor-go/examples/cluster-basic/shared";
44

5-
message Hello {
5+
message HelloRequest {
66
string name = 1;
77
}
8+
9+
message HelloResponse {
10+
11+
}

examples/cluster-broadcast/shared/protos.pb.go

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/cluster-broadcast/shared/protos_grain.pb.go

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/cluster-error-response/protos.pb.go

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/cluster-error-response/protos_grain.pb.go

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

examples/cluster-eventstream-broadcast/protos.pb.go

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
version: '3.7'
2+
services:
3+
4+
consul-agent-1: &consul-agent
5+
image: hashicorp/consul:latest
6+
networks:
7+
- consul
8+
command: "agent -retry-join consul-server-bootstrap -client 0.0.0.0"
9+
10+
consul-agent-2:
11+
<<: *consul-agent
12+
13+
consul-agent-3:
14+
<<: *consul-agent
15+
16+
consul-server-1: &consul-server
17+
<<: *consul-agent
18+
command: "agent -server -retry-join consul-server-bootstrap -client 0.0.0.0"
19+
20+
consul-server-2:
21+
<<: *consul-server
22+
23+
consul-server-bootstrap:
24+
<<: *consul-agent
25+
ports:
26+
- "8400:8400"
27+
- "8500:8500"
28+
- "8600:8600"
29+
- "8600:8600/udp"
30+
command: "agent -server -bootstrap-expect 3 -ui -client 0.0.0.0"
31+
32+
mongodb:
33+
image: mongo:latest
34+
ports:
35+
- 127.0.0.1:27017:27017
36+
volumes:
37+
- mongodb_data:/data/db
38+
39+
redis:
40+
image: redis:latest
41+
ports:
42+
- 127.0.0.1:6379:6379
43+
44+
networks:
45+
consul:
46+
47+
volumes:
48+
mongodb_data:

0 commit comments

Comments
 (0)