2 Star 6 Fork 5

Plato/rpc-go-backend

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
service.go 822 Bytes
一键复制 编辑 原始数据 按行查看 历史
CloudGuan 提交于 2023-06-30 08:37 . !13ISSUE: Customize the call context
package idlrpc
// IService user custom service framework interface
type IService interface {
// GetUUID service uuid, generated by rpc-repo
GetUUID() uint64
// GetNickName return custom service nickname !
GetNickName() string
// OnAfterFork init service by framework, user can init some custom data in this function
OnAfterFork(ctx IServiceContext) bool
// OnTick tick your service the same goroutine
OnTick() bool
//OnSubscribe will be triggered when a subscriber subscribes to an event
OnSubscribe(string, string, []byte) error
// OnCancel e triggered when a subscriber cancel
OnCancel(string, string) error
// OnBeforeDestroy before service unload, you can clean your own data in this func
OnBeforeDestroy() bool
}
// ServiceCreator service creator
type ServiceCreator func(interface{}) IService
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/dennis-kk/rpc-go-backend.git
git@gitee.com:dennis-kk/rpc-go-backend.git
dennis-kk
rpc-go-backend
rpc-go-backend
v0.5.4

搜索帮助