MCPcopy
hub / github.com/nats-io/nats.go / ChanSubscribe

Method ChanSubscribe

nats.go:4804–4806  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

4802// all messages received on the channel.
4803// You should not close the channel until sub.Unsubscribe() has been called.
4804func (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

Callers 1

TestNilConnectionFunction · 0.95

Calls 1

subscribeMethod · 0.95

Tested by 1

TestNilConnectionFunction · 0.76