feat 添加SetErrorHandle方法
This commit is contained in:
parent
adcb9ed31b
commit
35b6608cc1
@ -57,6 +57,11 @@ func (s *Server) Unsubscribe(channel string) error {
|
|||||||
return s.pubSub.Unsubscribe(s.ctx, channel)
|
return s.pubSub.Unsubscribe(s.ctx, channel)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (s *Server) SetErrorHandle(f func(err error)) *Server {
|
||||||
|
s.errHandle = f
|
||||||
|
return s
|
||||||
|
}
|
||||||
|
|
||||||
func (s *Server) Run() {
|
func (s *Server) Run() {
|
||||||
ch := s.pubSub.Channel()
|
ch := s.pubSub.Channel()
|
||||||
defer s.pubSub.Close()
|
defer s.pubSub.Close()
|
||||||
|
Loading…
Reference in New Issue
Block a user