Use futures crate to await collection rendering concurrently

This commit is contained in:
Reinout Meliesie 2025-02-12 10:27:29 +01:00
parent 85b0fc2f21
commit e633000de5
Signed by: zedfrigg
GPG key ID: 3AFCC06481308BC6
3 changed files with 33 additions and 3 deletions

View file

@ -2,6 +2,7 @@ mod collatable_container ;
mod component ;
mod utility ;
use futures :: * ;
use gtk4 :: Orientation :: * ;
use gtk4 :: prelude :: * ;
use libadwaita :: * ;
@ -49,8 +50,9 @@ impl UI {
pub fn close_window ( & self ) { self . window . close () }
pub async fn render_collection_overview ( & self , collection : CollectionOverview ) {
// TODO: Find a way to await these futures concurrently
self . films_component . set_media ( collection . films ) . await ;
self . series_component . set_media ( collection . series ) . await ;
join ! (
self . films_component . set_media ( collection . films ) ,
self . series_component . set_media ( collection . series ) ,
) ;
}
}