@@ -4,12 +4,15 @@ use obelisk::{
44 types:: time:: { Duration , ScheduleAt } ,
55 workflow:: workflow_support:: { self , ClosingStrategy , new_join_set_generated} ,
66} ;
7+ use std:: collections:: HashSet ;
78use tutorial:: {
89 activity:: activity_sleepy:: step,
910 activity_obelisk_ext:: activity_sleepy:: { step_await_next, step_submit} ,
1011} ;
1112use wit_bindgen:: generate;
1213
14+ mod util;
15+
1316generate ! ( { generate_all } ) ;
1417struct Component ;
1518export ! ( Component ) ;
@@ -30,14 +33,15 @@ impl Guest for Component {
3033 Ok ( acc)
3134 }
3235
36+ #[ allow( clippy:: mutable_key_type) ]
3337 fn parallel ( ) -> Result < u64 , ( ) > {
3438 log:: info ( "parallel started" ) ;
3539 let max_iterations = 10 ;
36- let mut handles = Vec :: new ( ) ;
40+ let mut handles = HashSet :: new ( ) ;
3741 for i in 0 ..max_iterations {
3842 let join_set = new_join_set_generated ( ClosingStrategy :: Complete ) ;
3943 step_submit ( & join_set, i, i * 200 ) ;
40- handles. push ( ( i, join_set) ) ;
44+ handles. insert ( ( i, join_set) ) ;
4145 }
4246 log:: info ( "parallel submitted all child executions" ) ;
4347 let mut acc = 0 ;
0 commit comments