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

Method ChanQueueSubscribe

nats.go:4814–4816  ·  view source on GitHub ↗

ChanQueueSubscribe will express interest in the given subject. All subscribers with the same queue name will form the queue group and only one member of the group will be selected to receive any given message, which will be placed on the channel. You should not close the channel until sub.Unsubscrib

(subj, group string, ch chan *Msg)

Source from the content-addressed store, hash-verified

4812// You should not close the channel until sub.Unsubscribe() has been called.
4813// Note: This is the same than QueueSubscribeSyncWithChan.
4814func (nc *Conn) ChanQueueSubscribe(subj, group string, ch chan *Msg) (*Subscription, error) {
4815 return nc.subscribe(subj, group, nil, ch, nil, false, nil)
4816}
4817
4818// SubscribeSync will express interest on the given subject. Messages will
4819// be received synchronously using Subscription.NextMsg().

Callers 1

TestNilConnectionFunction · 0.95

Calls 1

subscribeMethod · 0.95

Tested by 1

TestNilConnectionFunction · 0.76