diff --git a/subscribe/redis/redis.go b/subscribe/redis/redis.go index 5ce6e6a..e29a626 100644 --- a/subscribe/redis/redis.go +++ b/subscribe/redis/redis.go @@ -52,7 +52,7 @@ func (s *Subscribers) Stop() error { return nil } -func (s *Subscribers) Subscribe(channel string) (chan<- *subscribe.Message, error) { +func (s *Subscribers) Subscribe(channel string) (<-chan *subscribe.Message, error) { if _, ok := s.subscriptions[channel]; ok { return nil, subscribe.ChannelExistError{Channel: channel} } diff --git a/subscribe/subscriber.go b/subscribe/subscriber.go index f7456dc..2c70b04 100644 --- a/subscribe/subscriber.go +++ b/subscribe/subscriber.go @@ -24,6 +24,6 @@ type Subscriber interface { Start() error Stop() error - Subscribe(channel string) (chan<- *Message, error) + Subscribe(channel string) (<-chan *Message, error) Unsubscribe(channel string) error }