pub async fn reload_models(&self) {
        let models = {
            let this = self.clone();
            let state = self.state();

            let models = state
                .models
                .iter()
                .map(|m| m.value.clone())
                .collect::<Vec<Model>>();

            for model in models.iter().cloned() {
                let this = this.clone();
                let path = model.state().path().to_path_buf();
                *model.state() = ResourceState::new_pending(path.clone());

                #[cfg(target_arch = "wasm32")]
                crate::core::wasm_bindgen_futures::spawn_local(async move {
                    reload_model(model, path, this).await;
                });

                #[cfg(not(target_arch = "wasm32"))]
                state.thread_pool.spawn_ok(async move {
                    reload_model(model, path, this).await;
                })
            }

            models
        };

        crate::core::futures::future::join_all(models).await;

        Log::writeln(
            MessageKind::Information,
            "All model resources reloaded!".to_owned(),
        );
    }
/// Reloads every loaded model. This method is asynchronous, internally it uses thread pool
/// to run reload on separate thread per model.
Reloads every loaded model. This method is asynchronous, internally it uses thread pool
to run reload on separate thread per model.
Reloads every loaded model . This method is asynchronous internally it uses thread pool to run reload on separate thread per model .
pub async fn reload_models(&self) {
        let models = {
            let this = self.clone();
            let state = self.state();
            let models = state
                .models
                .iter()
                .map(|m| m.value.clone())
                .collect::<Vec<Model>>();
            for model in models.iter().cloned() {
                let this = this.clone();
                let path = model.state().path().to_path_buf();
                *model.state() = ResourceState::new_pending(path.clone());
                #[cfg(target_arch = "wasm32")]
                crate::core::wasm_bindgen_futures::spawn_local(async move {
                    reload_model(model, path, this).await;
                });
                #[cfg(not(target_arch = "wasm32"))]
                state.thread_pool.spawn_ok(async move {
                    reload_model(model, path, this).await;
                })
            }
            models
        };
        crate::core::futures::future::join_all(models).await;
        Log::writeln(
            MessageKind::Information,
            "All model resources reloaded!".to_owned(),
        );
    }
pub async fn reload_models ( & self ) { let models = { let this = self . clone ( ) ; let state = self . state ( ) ; let models = state . models . iter ( ) . map ( | m | m . value . clone ( ) ) . collect :: < Vec < Model > > ( ) ; for model in models . iter ( ) . cloned ( ) { let this = this . clone ( ) ; let path = model . state ( ) . path ( ) . to_path_buf ( ) ; * model . state ( ) = ResourceState :: new_pending ( path . clone ( ) ) ; # [ cfg ( target_arch " " ) ] crate :: core :: wasm_bindgen_futures :: spawn_local ( async move { reload_model ( model , path , this ) . await ; } ) ; # [ cfg ( not ( target_arch " " ) ) ] state . thread_pool . spawn_ok ( async move { reload_model ( model , path , this ) . await ; } ) } models } ; crate :: core :: futures :: future :: join_all ( models ) . await ; Log :: writeln ( MessageKind :: Information , " " . to_owned ( ) , ) ; }
Reloads every loaded model.
Reloads every loaded model .
&self