Skip to content

BasicDeliverEventArgs.Body - correct usage #1660

Answered by gradx
gradx asked this question in Q&A
Discussion options

You must be logged in to vote

After working with @lukebakken he helped me discover that BasicDeliverEventArgs is not thread-safe. Perhaps BasicDeliverEventArgs .Body should be marked as Obsolete and a descriptor added to indicate how to handle it better similar to how the RecyclableMemoryStream does so any references display an obvious issue:

        /// <summary>
        /// Returns a new array with a copy of the buffer's contents. You should almost certainly be using <see cref="GetBuffer"/> combined with the <see cref="Length"/> to
        /// access the bytes in this stream. Calling <c>ToArray</c> will destroy the benefits of pooled buffers, but it is included
        /// for the sake of completeness.
        /// <…

Replies: 9 comments 17 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@lukebakken
Comment options

@michaelklishin
Comment options

Comment options

You must be logged in to vote
1 reply
@gradx
Comment options

Comment options

You must be logged in to vote
2 replies
@gradx
Comment options

@gradx
Comment options

Comment options

You must be logged in to vote
4 replies
@gradx
Comment options

@lukebakken
Comment options

@gradx
Comment options

@gradx
Comment options

Comment options

You must be logged in to vote
2 replies
@lukebakken
Comment options

@lukebakken
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
6 replies
@gradx
Comment options

@michaelklishin
Comment options

@lukebakken
Comment options

@gradx
Comment options

@lukebakken
Comment options

Answer selected by gradx
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants
Converted from issue

This discussion was converted from issue #1660 on August 28, 2024 22:41.