Skip to content
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

Protect async send from misuse #725

Closed
wants to merge 1 commit into from

Conversation

javalikescript
Copy link
Contributor

@javalikescript javalikescript commented Oct 25, 2024

This is a proposal to mitigate the async send issues, see #505
⚠️This is a breaking change as some misuse could work but with unexpected behavior.

Using arguments when calling async send is helpful but does not match the libuv implementation that will coalesce calls.
Properly supporting multiple calls is a lot of work and may not be interesting for luv.

I propose to restrict the usage by allowing arguments only when async send is used just once.
It is still possible to call multiple times async send without arguments which is the libuv API.
It seems to me to be a simple but necessary fix.

Another option would be to use a lock to be able to change the arguments and free the not yet received ones, but there will be no guaranty on which arguments will be effectively received. This option is only interesting to avoid breaking existing misuse.

@javalikescript javalikescript marked this pull request as draft November 4, 2024 06:40
@javalikescript
Copy link
Contributor Author

Closing in favor of #729

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.

1 participant