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

Method QueueSubscribeSyncWithChan

nats.go:4859–4861  ·  view source on GitHub ↗

QueueSubscribeSyncWithChan 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.Un

(subj, queue string, ch chan *Msg)

Source from the content-addressed store, hash-verified

4857// You should not close the channel until sub.Unsubscribe() has been called.
4858// Note: This is the same than ChanQueueSubscribe.
4859func (nc *Conn) QueueSubscribeSyncWithChan(subj, queue string, ch chan *Msg) (*Subscription, error) {
4860 return nc.subscribe(subj, queue, nil, ch, nil, false, nil)
4861}
4862
4863// badSubject will do quick test on whether a subject is acceptable.
4864// Spaces are not allowed and all tokens should be > 0 in len.

Callers 3

TestNilConnectionFunction · 0.95

Calls 1

subscribeMethod · 0.95

Tested by 3

TestNilConnectionFunction · 0.76