mirror of
https://github.com/tmrts/go-patterns.git
synced 2026-11-11 23:07:51 +03:00
Nothing special on Subscription (#5)
This commit is contained in:
1 parent
3d2d78a8a2
commit
3da8fc4d4f
1 file changed
+2
-2
@@ -27,11 +27,11 @@ type Subscription struct {
|
||||
}
|
||||
|
||||
func (s *Subscription) Publish(msg Message) error {
|
||||
if _, ok := ch; !ok {
|
||||
if _, ok := s.ch; !ok {
|
||||
return errors.New("Topic has been closed")
|
||||
}
|
||||
|
||||
ch <- msg
|
||||
s.ch <- msg
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user