From da4a7d52850eae15c0bcac309d09b54a0588278c Mon Sep 17 00:00:00 2001 From: Greg Johnston Date: Wed, 29 Oct 2025 21:07:52 -0400 Subject: [PATCH] examples: clarify behavior of upload-with-progress demo (closes #4397) (#4420) --- examples/server_fns_axum/src/app.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/examples/server_fns_axum/src/app.rs b/examples/server_fns_axum/src/app.rs index f81a38921..cb302f2a1 100644 --- a/examples/server_fns_axum/src/app.rs +++ b/examples/server_fns_axum/src/app.rs @@ -440,7 +440,14 @@ pub fn FileUploadWithProgress() -> impl IntoView { let mut entry = FILES.entry(filename.to_string()).or_insert_with(|| { println!("[{filename}]\tinserting channel"); - let (tx, rx) = broadcast(128); + // NOTE: this channel capacity is set arbitrarily for this demo code. + // it allows for up to exactly 1048 chunks to be sent, which sets an upper cap + // on upload size (the precise details vary by client) + // in a real system, you will want to create some more reasonable ways of + // sending and sharing notifications + // + // see https://github.com/leptos-rs/leptos/issues/4397 for related discussion + let (tx, rx) = broadcast(1048); File { total: 0, tx, rx } }); entry.total += len;