Skip to content

Conversation

@abramk
Copy link

@abramk abramk commented Jul 7, 2023

If you are sending large amounts of data (multiple megabytes) and you don't want to allocate that large a byte slice, one option is to send the data and have a mechanism to Wake() the connection up after the write is done. This will require a postWrite(conn) hook that also provides a reference to the connection for which data was just written. This way the application can maintain state in the context and in the postWrite hook, call Wake() and send the next batch of data when the Data() hook gets called.

If you are sending large amounts of data (multiple megabytes) and you don't want to allocate that large a byte slice, one option is to send the data and have a mechanism to Wake() the connection up after the write is done. This will require a postWrite(conn) hook that also provides a reference to the connection for which data was just written. This way the application can maintain state in the context and in the postWrite hook, call Wake() and send the next batch of data when the Data() hook gets called.
@abramk
Copy link
Author

abramk commented Jul 7, 2023

@tidwall kindly let me know if you are able to incorporate this and push a release.

@abramk
Copy link
Author

abramk commented Jul 14, 2023

@tidwall any update on this?

@tidwall
Copy link
Owner

tidwall commented Jul 14, 2023

I'm not accepting pull requests at this time.

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.

2 participants