イベントをpushすると購読しているクライアントにイベントが通知されるだけのシンプルなサーバーです。
gRPCを使用しているのでクライアント側は任意の言語で実装することができます。
イベント名は任意のstring、push時にイベント名とmessageを指定。そのイベント名を購読している
クライアントのみにmessageが通知される(詳細はprotocol buffersを参照)
- go version >=v1.11 (use modules)
- git clone ${GOPATH}/github.com/sakokazuki/simplegrpc or any directory
git clone ${remoteurl} ${GOPATH}/github.com/sakokazuki/simplegrpc
or
git clone ${remoteurl} simplegrpc
- cd
cd simplegrpc
- build and automatically update go.mod and download dependencies if needed.
make build
orgo build -tags=release
make dev
or go run main.go
./simplegrpc
and server start at localhost:10151
サーバーに接続して定期的にイベントを発行するだけのシンプルなクライアントを一応用意しました。
make client
orcd client
go run main.go
https://github.com/sakokazuki/SimplegrpcClientForUnity
- サーバーのポートを起動時に設定できるように
- デバッグ用webサーバー用意
- テスト書いてみる?
コードの殆どはこれを参考にした
plasma (https://github.com/openfresh/plasma)