ing
This commit is contained in:
parent
1092f7a7ae
commit
dcc3af0723
|
@ -279,7 +279,8 @@ LOOP:
|
|||
logging.Logger().Debug(err)
|
||||
continue LOOP
|
||||
}
|
||||
if nil == resCodec.ID() {
|
||||
|
||||
if resCodec.IsNotification() {
|
||||
// notification
|
||||
notiCodec, err := resCodec.Notification()
|
||||
if nil != err {
|
||||
|
|
|
@ -7,6 +7,7 @@ type ClientCodec interface {
|
|||
}
|
||||
|
||||
type ClientResponseCodec interface {
|
||||
IsNotification() bool
|
||||
Notification() (ClientNotificationCodec, error)
|
||||
Result(result interface{}) error
|
||||
Error() *Error
|
||||
|
|
|
@ -42,6 +42,13 @@ func (crc *ClientResponseCodec) Error() *protocol.Error {
|
|||
return crc.res.Error
|
||||
}
|
||||
|
||||
func (crc *ClientResponseCodec) IsNotification() bool {
|
||||
if nil == crc.res.ID && nil != crc.res.Result {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func (crc *ClientResponseCodec) Notification() (protocol.ClientNotificationCodec, error) {
|
||||
if nil != crc.res.ID || nil == crc.res.Result {
|
||||
return nil, fmt.Errorf("This is not notification")
|
||||
|
|
Loading…
Reference in New Issue
Block a user