2 Star 0 Fork 0

MixerJ/pitaya

Create your Gitee Account
Explore and code with more than 13.5 million developers,Free private repositories !:)
Sign up
文件
Clone or Download
room.go 703 Bytes
Copy Edit Raw Blame History
MixerJ authored 2020-07-18 16:58 +08:00 . !1go mod
package services
import (
"context"
"gitee.com/mixerj/pitaya"
"gitee.com/mixerj/pitaya/component"
"gitee.com/mixerj/pitaya/examples/demo/worker/protos"
"gitee.com/mixerj/pitaya/logger"
)
// Room server
type Room struct {
component.Base
}
// CallLog makes ReliableRPC to metagame LogRemote
func (*Room) CallLog(ctx context.Context, arg *protos.Arg) (*protos.Response, error) {
route := "metagame.metagame.logremote"
reply := &protos.Response{}
jid, err := pitaya.ReliableRPC(route, nil, reply, arg)
if err != nil {
logger.Log.Infof("failed to enqueue rpc: %q", err)
return nil, err
}
logger.Log.Infof("enqueue rpc job: %d", jid)
return &protos.Response{Code: 200, Msg: "ok"}, nil
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/mixerj/pitaya.git
git@gitee.com:mixerj/pitaya.git
mixerj
pitaya
pitaya
4e7898a663a6

Search