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

Function NewInbox

nats.go:4719–4726  ·  view source on GitHub ↗

NewInbox will return an inbox string which can be used for directed replies from subscribers. These are guaranteed to be unique, but can be shared and subscribed to by others.

()

Source from the content-addressed store, hash-verified

4717// subscribers. These are guaranteed to be unique, but can be shared and subscribed
4718// to by others.
4719func NewInbox() string {
4720 var b [inboxPrefixLen + nuidSize]byte
4721 pres := b[:inboxPrefixLen]
4722 copy(pres, InboxPrefix)
4723 ns := b[inboxPrefixLen:]
4724 copy(ns, nuid.Next())
4725 return string(b[:])
4726}
4727
4728// Create a new inbox that is prefix aware.
4729func (nc *Conn) NewInbox() string {

Callers 1

NewInboxMethod · 0.85

Calls 1

NextMethod · 0.65

Tested by

no test coverage detected