-
Notifications
You must be signed in to change notification settings - Fork 786
Open
Labels
proposalEnhancement idea or proposalEnhancement idea or proposal
Description
Proposed change
The Go docs should specify the *nats.Msg lifecycle. Looking at the code I can see that a new struct is allocated per message, however that doesn't give me the confidence to know that this wont change.
Use case
We have async processing of messages and there is no clear guidance on whether we can store a reference to the *nats.Msg received in the callback for later processing, or if it may be reused after the function returns. For safety I've opted for being defensive and copying the message before queueing it up for async processing, however if there was some documentation specifying the behaviour we could omit this extra step.
Contribution
No response
Metadata
Metadata
Assignees
Labels
proposalEnhancement idea or proposalEnhancement idea or proposal