newRespInbox creates a new literal response subject that will trigger the mux subscription handler. Lock should be held.
()
| 4751 | // that will trigger the mux subscription handler. |
| 4752 | // Lock should be held. |
| 4753 | func (nc *Conn) newRespInbox() string { |
| 4754 | if nc.respMap == nil { |
| 4755 | nc.initNewResp() |
| 4756 | } |
| 4757 | |
| 4758 | var sb strings.Builder |
| 4759 | sb.WriteString(nc.respSubPrefix) |
| 4760 | |
| 4761 | rn := nc.respRand.Int63() |
| 4762 | for i := 0; i < replySuffixLen; i++ { |
| 4763 | sb.WriteByte(rdigits[rn%base]) |
| 4764 | rn /= base |
| 4765 | } |
| 4766 | |
| 4767 | return sb.String() |
| 4768 | } |
| 4769 | |
| 4770 | // NewRespInbox is the new format used for _INBOX. |
| 4771 | func (nc *Conn) NewRespInbox() string { |
no test coverage detected