overflow_probe_container/service/ProbeService.go
crusader b040fbf794 ing
2018-03-23 02:23:26 +09:00

29 lines
556 B
Go

package service
import (
"reflect"
"sync"
cda "git.loafle.net/commons_go/di/annotation"
cdr "git.loafle.net/commons_go/di/registry"
cr "git.loafle.net/commons_go/rpc"
)
func init() {
cdr.RegisterType(reflect.TypeOf((*ProbeService)(nil)))
}
type ProbeService struct {
cda.TypeAnnotation `annotation:"@overFlow:Service()"`
RPCServlet cr.Servlet
sendMtx sync.RWMutex
}
func (ps *ProbeService) Send(method string, params ...interface{}) error {
ps.sendMtx.RLock()
defer ps.sendMtx.RUnlock()
return ps.RPCServlet.Send(method, params...)
}