#How to pass a context that needs async?
1 messages · Page 1 of 1 (latest)
unfortunately that is the easiest approach today
The async runtime on the server and client is different so you can't annotate main with #[tokio::main]
and you do need to block on the future before rendering anything
but couldnt a with_context_future take in a future, and then that future is blocked on/awaited by the internal axum launch sequence, which would then add to the context?
I would lean towards adding a #[dioxus::main] macro that chooses an async runtime based on the platform instead
Yes, we could allow that, but the behavior is less immediately clear (does it block or add the context after it resolves?)
true
And what if my context returns an error or the context?