{"id":16156583,"url":"https://github.com/oklahomer/protoactor-go-sender-example","last_synced_at":"2026-03-13T01:32:21.737Z","repository":{"id":48697310,"uuid":"148329514","full_name":"oklahomer/protoactor-go-sender-example","owner":"oklahomer","description":"Some example codes to illustrate how protoactor-go refers to sender process","archived":false,"fork":false,"pushed_at":"2022-07-24T06:00:22.000Z","size":433,"stargazers_count":37,"open_issues_count":1,"forks_count":5,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-02-28T12:06:30.317Z","etag":null,"topics":["actor-model","consul","etcd","golang","protoactor","protoactor-go"],"latest_commit_sha":null,"homepage":"https://blog.oklahome.net/2018/09/protoactor-go-messaging-protocol.html","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/oklahomer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-09-11T14:22:23.000Z","updated_at":"2024-04-13T07:01:29.000Z","dependencies_parsed_at":"2022-08-31T08:21:50.295Z","dependency_job_id":null,"html_url":"https://github.com/oklahomer/protoactor-go-sender-example","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oklahomer%2Fprotoactor-go-sender-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oklahomer%2Fprotoactor-go-sender-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oklahomer%2Fprotoactor-go-sender-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oklahomer%2Fprotoactor-go-sender-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/oklahomer","download_url":"https://codeload.github.com/oklahomer/protoactor-go-sender-example/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243950792,"owners_count":20373664,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["actor-model","consul","etcd","golang","protoactor","protoactor-go"],"created_at":"2024-10-10T01:45:21.342Z","updated_at":"2026-03-13T01:32:21.681Z","avatar_url":"https://github.com/oklahomer.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"This repository contains supplemental examples for my blog article, [[Golang] Protoactor-go 101: How actors communicate with each other](https://blog.oklahome.net/2018/09/protoactor-go-messaging-protocol.html) , to cover all message passing methods for all kinds of actors provided by protoactor-go.\n\n![](https://raw.githubusercontent.com/oklahomer/protoactor-go-sender-example/main/docs/components.png)\n\n# Local\nFor local message passing, see the below directories:\n- [local-send](./local-send/main.go) ... Use Send() for local message passing. The recipient actor cannot refer to the sender actor.\n- [local-request](./local-request/main.go) ... Use Request() for local message passing. The recipient actor can refer to the sender actor.\n- [local-future](./local-future/main.go) ... Use RequestFuture() for local message passing. Context.Sender() does not return the PID of sender actor but that of actor.Future.\n\n# Remote\n- [remote/messages](./remote/messages/) ... Contain Protobuf serializable message structures. See **README.md** for code generation.\n- [rmeote/remote-pong](./remote/remote-pong/main.go) ... A process that returns pong message to sender.\n- [remote/remote-ping-send](./remote/remote-ping-send/main.go) ... A process that sends message to pong actor by Send(). The recipient cannot refer to the sender actor.\n- [remote/remote-ping-request](./remote/remote-ping-request/main.go) ... A process that sends message to pong actor by Request(). The recipient actor can refer to the sender actor.\n- [remote/remote-ping-future](./remote/remote-ping-future/main.go) ... A process that sends message to pong actor by RequestFuture(). Context.Sender() does not return the PID of sender actor but that of actor.Future.\n\n# Cluster Grain\n- [cluster/messages](./cluster/messages/) ... Contain Protobuf serializable message structures and generated actor.Actor implementation for gRPC based communication. See **README.md** for code generation.\n\n## Cluster Grain usage with remote communication\nBelow examples use Consul Cluster Provider for service discovery. Run `docker-compose -f docker-compose.yml up --build -d` or something equivalent to run Consul on your local environment.\n- [cluster-consul/cluster-pong](./cluster-consul/cluster-pong/main.go) ... A process that returns pong message to the sender based on remote actor implementation.\n- [cluster-consul/cluster-ping-send](./cluster-consul/cluster-ping-send/main.go) ... A process that sends message to pong actor by Send(). The recipient cannot refer to the sender actor.\n- [cluster-consul/cluster-ping-request](./cluster-consul/cluster-ping-request/main.go) ... A process that sends message to pong actor by Request(). The recipient actor can refer to the sender actor.\n- [cluster-consul/cluster-ping-future](./cluster-consul/cluster-ping-future/main.go) ... A process that sends message to pong actor by RequestFuture(). Context.Sender() does not return the PID of sender actor but that of actor.Future.\n\n## Cluster Grain usage with gRPC based communication\nBelow examples use Consul Cluster Provider for service discovery. Run `docker-compose -f docker-compose.yml up --build -d` or something equivalent to run Consul on your local environment.\n- [cluster-consul/cluster-pong-grpc](./cluster-consul/cluster-pong-grpc/main.go) ... A process that returns pong message to the sender via gRPC service.\n- [cluster-consul/cluster-ping-grpc](./cluster-consul/cluster-ping-grpc/main.go) ... A process that sends message to pong actor over gRPC based service.\n\n## Cluster with Automanaged Cluster Provider\nBelow examples use Automanaged Cluster Provider for service discovery\n- [cluster-automanaged/cluster-pong](./cluster-automanaged/cluster-pong/main.go) ... A process that returns pong message to the sender based on remote actor implementation.\n- [cluster-automanaged/cluster-ping-future](./cluster-automanaged/cluster-ping-future/main.go) ... A process that sends message to pong actor by Request(). The recipient actor can refer to the sender actor and therefore can successfully respond.\n\n## Cluster with etcd Cluster Provider\nBelow examples uses etcd Cluster Provider for service discovery. Run `docker-compose -f docker-compose.yml up --build -d` or something equivalent to run etcd on your local environment.\n- [cluster-etcd/cluster-pong](./cluster-etcd/cluster-pong/main.go) ... A process that returns pong message to the sender based on remote actor implementation.\n- [cluster-etcd/cluster-ping-future](./cluster-etcd/cluster-ping-future/main.go) ... A process that sends message to pong actor by Request(). The recipient actor can refer to the sender actor and therefore can successfully respond.\n\n# References\n- [[Golang] Protoactor-go 101: Introduction to golang's actor model implementation](https://blog.oklahome.net/2018/07/protoactor-go-introduction.html)\n- [[Golang] Protoactor-go 101: How actors communicate with each other](https://blog.oklahome.net/2018/09/protoactor-go-messaging-protocol.html)\n- [[Golang] protoactor-go 101: How actor.Future works to synchronize concurrent task execution](https://blog.oklahome.net/2018/11/protoactor-go-how-future-works.html)\n- [[Golang] protoactor-go 201: How middleware works to intercept incoming and outgoing messages](https://blog.oklahome.net/2018/11/protoactor-go-middleware.html)\n- [[Golang] protoactor-go 201: Use plugins to add behaviors to an actor](https://blog.oklahome.net/2018/12/protoactor-go-use-plugin-to-add-behavior.html)\n- [[Golang] protoactor-go 301: How proto.actor's clustering works to achieve higher availability](https://blog.oklahome.net/2021/05/protoactor-clustering.html)\n\n# Other Example Codes\n- [oklahomer/protoactor-go-future-example](https://github.com/oklahomer/protoactor-go-future-example)\n  - Some example codes to illustrate how protoactor-go handles Future process\n- [oklahomer/protoactor-go-middleware-example](https://github.com/oklahomer/protoactor-go-middleware-example)\n  - Some example codes to illustrate how protoactor-go use Middleware\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foklahomer%2Fprotoactor-go-sender-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foklahomer%2Fprotoactor-go-sender-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foklahomer%2Fprotoactor-go-sender-example/lists"}