-
-
Notifications
You must be signed in to change notification settings - Fork 68
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
Streaming API to write messages #111
Comments
Can you show an example of how the API would look. Not sure if I 100% understand it |
It would be great to have a concept of buffers inside Renet. Buffer is just |
This seems to be an allocation problem. Since we use Bytes, we mostly delegate to it. |
The way Renet uses it, there is not much help from |
After some thinking I have an alternative proposal: |
Currently in order to send a message, I need to pass anything that converts into
Bytes
.But this prevents users from re-using the memory.
Bytes
cheaply clonable, but can't grow, so users can't use it a buffer for snapshots.Vec<u8>
can be used as a buffer for snapshots, but it needs to be cloned to send (because conversion fromVec<u8>
toBytes
implemented only from owning value).Maybe provide a streaming API instead where you write messages directly into Renet's message buffer?
The text was updated successfully, but these errors were encountered: