SubscribeSync creates a Subscription that can be used to process messages synchronously. See important note in Subscribe()
(subj string, opts ...SubOpt)
| 1510 | // SubscribeSync creates a Subscription that can be used to process messages synchronously. |
| 1511 | // See important note in Subscribe() |
| 1512 | func (js *js) SubscribeSync(subj string, opts ...SubOpt) (*Subscription, error) { |
| 1513 | mch := make(chan *Msg, js.nc.Opts.SubChanLen) |
| 1514 | return js.subscribe(subj, _EMPTY_, nil, mch, true, false, opts) |
| 1515 | } |
| 1516 | |
| 1517 | // QueueSubscribe creates a Subscription with a queue group. |
| 1518 | // If no optional durable name nor binding options are specified, the queue name will be used as a durable name. |