We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6f42541 commit 59eea6cCopy full SHA for 59eea6c
src/web/page/templates.rs
@@ -18,6 +18,15 @@ const TEMPLATES_DIRECTORY: &str = "templates";
18
#[derive(Debug)]
19
pub(crate) struct TemplateData {
20
pub templates: Tera,
21
+ /// rendering threadpool for CPU intensive rendering.
22
+ /// When the app is shut down, the pool won't wait
23
+ /// for pending tasks in this pool.
24
+ /// In the case of rendering, this is what we want.
25
+ /// See also https://github.com/rayon-rs/rayon/issues/688.
26
+ ///
27
+ /// This is better than using `tokio::spawn_blocking` because
28
+ /// tokio will wait until all tasks are finished when shutting
29
+ /// down.
30
rendering_threadpool: rayon::ThreadPool,
31
}
32
0 commit comments