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

Method QueueSubscribeSync

nats.go:4844–4851  ·  view source on GitHub ↗

QueueSubscribeSync creates a synchronous queue subscriber on 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 synchronously using Subscription.NextMsg().

(subj, queue string)

Source from the content-addressed store, hash-verified

4842// group and only one member of the group will be selected to receive any
4843// given message synchronously using Subscription.NextMsg().
4844func (nc *Conn) QueueSubscribeSync(subj, queue string) (*Subscription, error) {
4845 mch := make(chan *Msg, nc.Opts.SubChanLen)
4846 var errCh chan error
4847 if nc.Opts.PermissionErrOnSubscribe {
4848 errCh = make(chan error, 100)
4849 }
4850 return nc.subscribe(subj, queue, nil, mch, errCh, true, nil)
4851}
4852
4853// QueueSubscribeSyncWithChan will express interest in the given subject.
4854// All subscribers with the same queue name will form the queue group

Callers

nothing calls this directly

Calls 1

subscribeMethod · 0.95

Tested by

no test coverage detected