add SendWaitObj Fn

This commit is contained in:
2022-01-07 15:07:24 +08:00
parent 555bc3653e
commit 3964cd05b0
4 changed files with 22 additions and 5 deletions
+8
View File
@@ -449,6 +449,14 @@ func (s *ServerCommon) SendWait(c *ClientConn, key string, value MsgVal, timeout
}, timeout)
}
func (s *ServerCommon) SendWaitObj(c *ClientConn, key string, value interface{}, timeout time.Duration) (Message, error) {
data, err := s.sequenceEn(value)
if err != nil {
return Message{}, err
}
return s.SendWait(c, key, data, timeout)
}
func (s *ServerCommon) SendObjCtx(ctx context.Context, c *ClientConn, key string, val interface{}) (Message, error) {
data, err := s.sequenceEn(val)
if err != nil {