Skip to content

Improve documentation about sharing state with handlers #3333

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

Merged
merged 1 commit into from
Apr 30, 2025

Conversation

jplatte
Copy link
Member

@jplatte jplatte commented Apr 29, 2025

I think task-local variables could have better docs. This is a start. We should minimize the example as well, but I feel like that we'll lose some information now. Maybe we need more complete examples for each of the state-sharing mechanisms, outside of the crate root docs. Anyways, this change should make sense regardless of any bigger doc improvements.

@jplatte jplatte merged commit 80c4ead into main Apr 30, 2025
18 checks passed
@jplatte jplatte deleted the jplatte/sharing-state-docs branch April 30, 2025 08:03
Comment on lines +344 to +345
//! smol does not yet offer equivalent functionality at the time of writing (see
//! [this GitHub issue](https://github.com/smol-rs/async-executor/issues/139)).
Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm late, but just to check, axum only supports tokio and can't really run under smol anyway, right? I haven't seen any plans to make it runtime-agnostiv either. Just checking if I'm missing something?

Copy link
Member Author

Choose a reason for hiding this comment

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

No, actually. axum::serve uses tokio, but tokio is an optional dependency. There's smol-axum for an easy way of running an axum service on smol.

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.

3 participants