rpc/notify/notify_handlers.go
crusader 5dafb388b1 ing
2017-11-22 20:55:10 +09:00

33 lines
725 B
Go

package notify
import (
"git.loafle.net/commons_go/rpc/protocol"
)
type NotifyHandlers struct {
Codec protocol.ClientCodec
// The maximum number of pending requests in the queue.
//
// The number of pending requsts should exceed the expected number
// of concurrent goroutines calling client's methods.
// Otherwise a lot of ClientError.Overflow errors may appear.
//
// Default is DefaultPendingNotifies.
PendingNotifies int
}
func (nh *NotifyHandlers) GetCodec() protocol.ClientCodec {
return nh.Codec
}
func (nh *NotifyHandlers) GetPendingNotifies() int {
return nh.PendingNotifies
}
func (nh *NotifyHandlers) Validate() {
if nh.PendingNotifies <= 0 {
nh.PendingNotifies = DefaultPendingNotifies
}
}