public static < T > IPromise < List < T > > allMapped ( List < IPromise < T > > futures ) { Promise returned = new Promise ( ) ; Promise res = new Promise ( ) ; awaitSettle ( futures , res ) ; res . then ( ( r , e ) -> { if ( r != null ) { returned . resolve ( ( ( List < Promise > ) r ) . stream ( ) . map ( p -> p . get ( ) ) . collect ( Collectors . toList ( ) ) ) ; } else { returned . complete ( null , e ) ; } } ) ; return returned ; }
similar all but map promises to their content