mirror of
https://github.com/tmrts/go-patterns.git
synced 2024-11-22 04:56:09 +03:00
Nothing special on Subscription (#5)
This commit is contained in:
parent
3d2d78a8a2
commit
3da8fc4d4f
@ -27,11 +27,11 @@ type Subscription struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (s *Subscription) Publish(msg Message) error {
|
func (s *Subscription) Publish(msg Message) error {
|
||||||
if _, ok := ch; !ok {
|
if _, ok := s.ch; !ok {
|
||||||
return errors.New("Topic has been closed")
|
return errors.New("Topic has been closed")
|
||||||
}
|
}
|
||||||
|
|
||||||
ch <- msg
|
s.ch <- msg
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user