This commit is contained in:
crusader 2018-04-09 22:14:26 +09:00
parent a99bf0599a
commit 6ed6a69d47
2 changed files with 2 additions and 2 deletions

View File

@ -52,7 +52,7 @@ func (s *Subscribers) Stop() error {
return nil 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 { if _, ok := s.subscriptions[channel]; ok {
return nil, subscribe.ChannelExistError{Channel: channel} return nil, subscribe.ChannelExistError{Channel: channel}
} }

View File

@ -24,6 +24,6 @@ type Subscriber interface {
Start() error Start() error
Stop() error Stop() error
Subscribe(channel string) (chan<- *Message, error) Subscribe(channel string) (<-chan *Message, error)
Unsubscribe(channel string) error Unsubscribe(channel string) error
} }