ChanSubscribe will express interest in the given subject and place all messages received on the channel. You should not close the channel until sub.Unsubscribe() has been called.
(subj string, ch chan *Msg)
| 4802 | // all messages received on the channel. |
| 4803 | // You should not close the channel until sub.Unsubscribe() has been called. |
| 4804 | func (nc *Conn) ChanSubscribe(subj string, ch chan *Msg) (*Subscription, error) { |
| 4805 | return nc.subscribe(subj, _EMPTY_, nil, ch, nil, false, nil) |
| 4806 | } |
| 4807 | |
| 4808 | // ChanQueueSubscribe will express interest in the given subject. |
| 4809 | // All subscribers with the same queue name will form the queue group |