registerPAF will register for a PubAckFuture.
(id string, paf *pubAckFuture)
| 812 | |
| 813 | // registerPAF will register for a PubAckFuture. |
| 814 | func (js *js) registerPAF(id string, paf *pubAckFuture) (int, int) { |
| 815 | js.mu.Lock() |
| 816 | if js.pafs == nil { |
| 817 | js.pafs = make(map[string]*pubAckFuture) |
| 818 | } |
| 819 | paf.js = js |
| 820 | js.pafs[id] = paf |
| 821 | np := len(js.pafs) |
| 822 | maxpa := js.opts.maxpa |
| 823 | js.mu.Unlock() |
| 824 | return np, maxpa |
| 825 | } |
| 826 | |
| 827 | // Lock should be held. |
| 828 | func (js *js) getPAF(id string) *pubAckFuture { |