-
Notifications
You must be signed in to change notification settings - Fork 18k
proposal: io,net: add WriteMany interface #68625
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Related Issues and Documentation
(Emoji vote if this was helpful or unhelpful; more detailed feedback welcome in this discussion.) |
opening as a formal proposal to solve #21676, feel free to close a dup |
And in case of rehashing arguments from #21676 the problem I am seeing: func (*T) WritePayload(b []byte) error Here are the possible solutions today and why they are not that good:
|
Does defining a dual |
@jfrech Idk this is not this proposal feel free to open an other one. |
Proposal Details
This proposal aims at making a user-implementable version of
net.Buffers
.Add a new interface to
io
and implement it onnet.*
which implementnet.buffersWriter
:note: this return
int64
because it would be easy to build let's say 16GiB buffer on a 32bits pointer architecture by having the byte arrays alias each other.(*net.Buffers).WriteTo
would also check if the underlying implementation supportsio.ManyWriter
as well asnet.buffersWriter
.The text was updated successfully, but these errors were encountered: