Use futures crate to await collection rendering concurrently
This commit is contained in:
parent
85b0fc2f21
commit
e633000de5
3 changed files with 33 additions and 3 deletions
|
@ -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 ) ,
|
||||
) ;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue