public static < T > Promise traverse ( List < Supplier < Promise < T > > > queue ) { if ( queue . size ( ) == 0 ) { return Promise . success ( null ) ; } return queue . remove ( 0 ) . get ( ) . flatMap ( v -> traverse ( queue ) ) ; }
Execute promises step by step