MCPcopy
hub / github.com/nats-io/nats.go / newRespInbox

Method newRespInbox

nats.go:4753–4768  ·  view source on GitHub ↗

newRespInbox creates a new literal response subject that will trigger the mux subscription handler. Lock should be held.

()

Source from the content-addressed store, hash-verified

4751// that will trigger the mux subscription handler.
4752// Lock should be held.
4753func (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.
4771func (nc *Conn) NewRespInbox() string {

Callers 2

NewRespInboxMethod · 0.95

Calls 2

initNewRespMethod · 0.95
StringMethod · 0.45

Tested by

no test coverage detected