Skip to content

Expose Message.totalSize, Message.size, and Message.headerSize#1337

Open
EvanMerlock wants to merge 1 commit into
segmentio:mainfrom
EvanMerlock:main
Open

Expose Message.totalSize, Message.size, and Message.headerSize#1337
EvanMerlock wants to merge 1 commit into
segmentio:mainfrom
EvanMerlock:main

Conversation

@EvanMerlock

Copy link
Copy Markdown

This PR makes the 3 functions Message.totalSize, Message.size, and Message.headerSize public.

This is helpful for applications which may need to add a buffer before calling WriteMessages, or for applications that need to compute the size of the payload on the wire for other reasons.

Resolves #1254

@vbmithr

vbmithr commented Sep 23, 2025

Copy link
Copy Markdown

This feature would be very useful to me too!

@AlaricWhitney

Copy link
Copy Markdown

I would really like this too. Is there a reason why this is stalled?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make (msg *Message) totalSize() public

3 participants