mirror of
https://github.com/tmrts/go-patterns.git
synced 2026-02-04 14:46:19 +00:00
messaging/publish-subscribe: fix channel read
This commit is contained in:
@@ -27,7 +27,7 @@ type Subscription struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (s *Subscription) Publish(msg Message) error {
|
func (s *Subscription) Publish(msg Message) error {
|
||||||
if _, ok := s.ch; !ok {
|
if _, ok := <-s.ch; !ok {
|
||||||
return errors.New("Topic has been closed")
|
return errors.New("Topic has been closed")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user