fn asyncio_weather(
    db: web::Data<Pool>,
) -> impl Future<Item = HttpResponse, Error = AWError> {
    let mut result: Vec<Vec<WeatherAgg>> = vec![];

    db::execute(&db, Queries::GetTopTenHottestYears)
        .from_err()
        .and_then(move |res| {
            result.push(res);
            db::execute(&db, Queries::GetTopTenColdestYears)
                .from_err()
                .and_then(move |res| {
                    result.push(res);
                    db::execute(&db, Queries::GetTopTenHottestMonths)
                        .from_err()
                        .and_then(move |res| {
                            result.push(res);
                            db::execute(&db, Queries::GetTopTenColdestMonths)
                                .from_err()
                                .and_then(move |res| {
                                    result.push(res);
                                    fut_ok(result)
                                })
                        })
                })
        })
        .and_then(|res| Ok(HttpResponse::Ok().json(res)))
}
/// Version 1: Calls 4 queries in sequential order, as an asynchronous handler
Version 1: Calls 4 queries in sequential order, as an asynchronous handler
Version 1 : Calls 4 queries in sequential order as an asynchronous handler
fn asyncio_weather(
    db: web::Data<Pool>,
) -> impl Future<Item = HttpResponse, Error = AWError> {
    let mut result: Vec<Vec<WeatherAgg>> = vec![];
    db::execute(&db, Queries::GetTopTenHottestYears)
        .from_err()
        .and_then(move |res| {
            result.push(res);
            db::execute(&db, Queries::GetTopTenColdestYears)
                .from_err()
                .and_then(move |res| {
                    result.push(res);
                    db::execute(&db, Queries::GetTopTenHottestMonths)
                        .from_err()
                        .and_then(move |res| {
                            result.push(res);
                            db::execute(&db, Queries::GetTopTenColdestMonths)
                                .from_err()
                                .and_then(move |res| {
                                    result.push(res);
                                    fut_ok(result)
                                })
                        })
                })
        })
        .and_then(|res| Ok(HttpResponse::Ok().json(res)))
}
fn asyncio_weather ( db : web :: Data < Pool > , ) -> impl Future < Item = HttpResponse , Error = AWError > { let mut result : Vec < Vec < WeatherAgg > > = vec ! [ ] ; db :: execute ( & db , Queries :: GetTopTenHottestYears ) . from_err ( ) . and_then ( move | res | { result . push ( res ) ; db :: execute ( & db , Queries :: GetTopTenColdestYears ) . from_err ( ) . and_then ( move | res | { result . push ( res ) ; db :: execute ( & db , Queries :: GetTopTenHottestMonths ) . from_err ( ) . and_then ( move | res | { result . push ( res ) ; db :: execute ( & db , Queries :: GetTopTenColdestMonths ) . from_err ( ) . and_then ( move | res | { result . push ( res ) ; fut_ok ( result ) } ) } ) } ) } ) . and_then ( | res | Ok ( HttpResponse :: Ok ( ) . json ( res ) ) ) }
Version 1: Calls 4 queries in sequential order, as an asynchronous handler
Version 1 : Calls 4 queries in sequential order as an asynchronous handler
db
web::Data<Pool>