You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@Demonthos and I talked about Diouxs's use of middleware of middleware on server functions. The example given looks like this:
#[server]// Add a timeout middleware to the server function that will return an error if the function takes longer than 1 second to execute#[middleware(tower_http::timeout::TimeoutLayer::new(std::time::Duration::from_secs(1)))]pubasyncfntimeout() -> Result<(),ServerFnError>{
tokio::time::sleep(std::time::Duration::from_secs(2)).await;Ok(())}
This is only supported for Dioxus on the Tower based platforms, so Actix support would be unlikely here. It might necessitate the creation of separate Actix and Axum server function crates.
I'd love to see this as an option in the Axum Leptos version
The text was updated successfully, but these errors were encountered:
benwis
changed the title
Add #[metadata] tag to allow the selective targeting of Tower services on Server Fns
Add #[iddleware] tag to allow the selective targeting of Tower services on Server Fns
Dec 15, 2023
benwis
changed the title
Add #[iddleware] tag to allow the selective targeting of Tower services on Server Fns
Add #[middleware] tag to allow the selective targeting of Tower services on Server Fns
Dec 15, 2023
@Demonthos and I talked about Diouxs's use of middleware of middleware on server functions. The example given looks like this:
And is implemented in Dioxus here:
https://github.com/DioxusLabs/dioxus/blob/master/packages/fullstack/src/adapters/mod.rs
This is only supported for Dioxus on the Tower based platforms, so Actix support would be unlikely here. It might necessitate the creation of separate Actix and Axum server function crates.
I'd love to see this as an option in the Axum Leptos version
The text was updated successfully, but these errors were encountered: