Skip to content

Comments

Rewrite the net standard library with smol ecosystem of crates#310

Merged
filiptibell merged 47 commits intomainfrom
smol-net
Apr 29, 2025
Merged

Rewrite the net standard library with smol ecosystem of crates#310
filiptibell merged 47 commits intomainfrom
smol-net

Conversation

@filiptibell
Copy link
Collaborator

The net standard library in Lune still uses tokio and related crates for its client + server + websockets implementation. This has lead to various bugs that are difficult to track down, and the global state in tokio tends to conflict with other parts of the async ecosystem that doesn't use tokio.

This PR migrates (really, rewrites) the net library to instead use async-* crates, including manual integrations with rustls and webpki for better control and future server-side TLS support. It still uses hyper for HTTP standards & request/response handling, and implements a few simple wrapper structs to integrate the non-tokio i/o with it.

The server now also supports automatic decompression of request bodies just like the client does for requests, and has generally better performance with less allocations.

@filiptibell filiptibell marked this pull request as ready for review April 27, 2025 20:11
Copy link
Collaborator Author

@filiptibell filiptibell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will leave migrating the main lune crate to async-* stuff for a later PR or commit. This one is big enough as is and is feature complete now with tests fixed & expanded.

@filiptibell filiptibell merged commit 62910f0 into main Apr 29, 2025
5 of 6 checks passed
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