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)
| 4842 | // group and only one member of the group will be selected to receive any |
| 4843 | // given message synchronously using Subscription.NextMsg(). |
| 4844 | func (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 |