This commit is contained in:
crusader 2017-09-27 16:38:43 +09:00
parent 20ad490e27
commit 9a532bb137
3 changed files with 3 additions and 3 deletions

View File

@ -75,7 +75,7 @@ func (s *subscribers) listenSubscriptions() {
switch v := s.conn.Receive().(type) {
case redis.Message:
if h, ok := s.subHandlers[v.Channel]; ok {
h.OnSubscribe(v.Channel, string(v.Data))
h.OnSubscribe(v.Channel, v.Data)
}
break
case redis.Subscription:

View File

@ -2,5 +2,5 @@ package overflow_subscriber
type SubscriberHandler interface {
GetChannel() string
OnSubscribe(channel string, payload string)
OnSubscribe(channel string, payload []byte)
}

View File

@ -7,5 +7,5 @@ type SubscriberHandlers struct {
func (h *SubscriberHandlers) GetChannel() string {
return h.Channel
}
func (h *SubscriberHandlers) OnSubscribe(channel string, payload string) {
func (h *SubscriberHandlers) OnSubscribe(channel string, payload []byte) {
}