SubscribeSync will express interest on the given subject. Messages will be received synchronously using Subscription.NextMsg().
(subj string)
| 4818 | // SubscribeSync will express interest on the given subject. Messages will |
| 4819 | // be received synchronously using Subscription.NextMsg(). |
| 4820 | func (nc *Conn) SubscribeSync(subj string) (*Subscription, error) { |
| 4821 | if nc == nil { |
| 4822 | return nil, ErrInvalidConnection |
| 4823 | } |
| 4824 | mch := make(chan *Msg, nc.Opts.SubChanLen) |
| 4825 | var errCh chan error |
| 4826 | if nc.Opts.PermissionErrOnSubscribe { |
| 4827 | errCh = make(chan error, 100) |
| 4828 | } |
| 4829 | return nc.subscribe(subj, _EMPTY_, nil, mch, errCh, true, nil) |
| 4830 | } |
| 4831 | |
| 4832 | // QueueSubscribe creates an asynchronous queue subscriber on the given subject. |
| 4833 | // All subscribers with the same queue name will form the queue group and |