diff --git a/redis/subscribers.go b/redis/subscribers.go index f00ddaf..0a6a53a 100644 --- a/redis/subscribers.go +++ b/redis/subscribers.go @@ -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: diff --git a/subscriber_handler.go b/subscriber_handler.go index 0998982..b8b6b5d 100644 --- a/subscriber_handler.go +++ b/subscriber_handler.go @@ -2,5 +2,5 @@ package overflow_subscriber type SubscriberHandler interface { GetChannel() string - OnSubscribe(channel string, payload string) + OnSubscribe(channel string, payload []byte) } diff --git a/subscriber_handlers.go b/subscriber_handlers.go index d1a7e7d..7f10b50 100644 --- a/subscriber_handlers.go +++ b/subscriber_handlers.go @@ -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) { }