代码拉取完成,页面将自动刷新
package idlrpc
import "context"
type ServiceStatus uint32
const (
SERVICE_RESOLVED ServiceStatus = iota + 1 //ready for servicing
SERVICE_UPDATING //stop receive message, wait for update
)
type (
//IStub rpc stub of service's side
IStub interface {
//GetUUID service uuid, generate by rpc-repo
GetUUID() SvcUuid
//GetServiceName service name
GetServiceName() string
//GetSignature method human-readable name
GetSignature(methodId uint32) string
//GetMutipleNum service goroutine num, read from idl keyword multiple
GetMutipleNum() uint32
//IsOneWay one way function, not send response
IsOneWay(methodId uint32) bool
// Call will trigger service's method
// return encode response buffer data and errors
Call(context.Context, uint32, []byte) ([]byte, error)
//OnAfterFork invoke by framework after spawned
//init service data or load db data in this function
OnAfterFork(ctx context.Context) bool
//OnBeforeDestroy invoke by framework before uninitialized
//clean service data in this function
OnBeforeDestroy() bool
//OnTick tick by service manager in logic tick
OnTick() bool
//GetStatus get service status
//TODO: for hot update
GetStatus() ServiceStatus
//SetStatus set service status
SetStatus(status ServiceStatus)
}
)
//StubCreator stub factory
type StubCreator func(v interface{}) IStub
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。