registerPAF will register for a PubAckFuture.
(id string, paf *pubAckFuture)
| 611 | |
| 612 | // registerPAF will register for a PubAckFuture. |
| 613 | func (js *jetStream) registerPAF(id string, paf *pubAckFuture) (int, int) { |
| 614 | js.publisher.Lock() |
| 615 | if js.publisher.acks == nil { |
| 616 | js.publisher.acks = make(map[string]*pubAckFuture) |
| 617 | } |
| 618 | js.publisher.acks[id] = paf |
| 619 | np := len(js.publisher.acks) |
| 620 | maxpa := js.publisher.asyncPublisherOpts.maxpa |
| 621 | js.publisher.Unlock() |
| 622 | return np, maxpa |
| 623 | } |
| 624 | |
| 625 | // Lock should be held. |
| 626 | func (js *jetStream) getPAF(id string) *pubAckFuture { |