ing
This commit is contained in:
parent
20ad490e27
commit
9a532bb137
|
@ -75,7 +75,7 @@ func (s *subscribers) listenSubscriptions() {
|
||||||
switch v := s.conn.Receive().(type) {
|
switch v := s.conn.Receive().(type) {
|
||||||
case redis.Message:
|
case redis.Message:
|
||||||
if h, ok := s.subHandlers[v.Channel]; ok {
|
if h, ok := s.subHandlers[v.Channel]; ok {
|
||||||
h.OnSubscribe(v.Channel, string(v.Data))
|
h.OnSubscribe(v.Channel, v.Data)
|
||||||
}
|
}
|
||||||
break
|
break
|
||||||
case redis.Subscription:
|
case redis.Subscription:
|
||||||
|
|
|
@ -2,5 +2,5 @@ package overflow_subscriber
|
||||||
|
|
||||||
type SubscriberHandler interface {
|
type SubscriberHandler interface {
|
||||||
GetChannel() string
|
GetChannel() string
|
||||||
OnSubscribe(channel string, payload string)
|
OnSubscribe(channel string, payload []byte)
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,5 +7,5 @@ type SubscriberHandlers struct {
|
||||||
func (h *SubscriberHandlers) GetChannel() string {
|
func (h *SubscriberHandlers) GetChannel() string {
|
||||||
return h.Channel
|
return h.Channel
|
||||||
}
|
}
|
||||||
func (h *SubscriberHandlers) OnSubscribe(channel string, payload string) {
|
func (h *SubscriberHandlers) OnSubscribe(channel string, payload []byte) {
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user