Skip to content

Instantly share code, notes, and snippets.

@jacobmischka
Created January 24, 2020 14:32
Show Gist options
  • Save jacobmischka/e82e24f576c7f9cbaf6f9aa6701202e1 to your computer and use it in GitHub Desktop.
Save jacobmischka/e82e24f576c7f9cbaf6f9aa6701202e1 to your computer and use it in GitHub Desktop.
{
// This is disgusting, I think I could use streams instead
let all_mentorships = fetch_records::<Mentorship>(&ids, &dates);
let all_publications = fetch_records::<Publication>(&ids, &dates);
let all_presentations = fetch_records::<Presentation>(&ids, &dates);
let all_research_grants_awards = fetch_records::<ResearchGrantAward>(&ids, &dates);
let all_committee_service = fetch_records::<CommitteeService>(&ids, &dates);
let all_leadership_positions =
fetch_records::<LeadershipAndCommitteePosition>(&ids, &dates);
let all_program_developments = fetch_records::<ProgramDevelopment>(&ids, &dates);
let all_appointments = fetch_records::<Appointment>(&ids, &dates);
let all_awards_memberships = fetch_records::<AwardHonorMembership>(&ids, &dates);
let all_specialty_boards = fetch_records::<SpecialtyBoardCertification>(&ids, &dates);
let all_teaching_activity = fetch_records::<TeachingActivity>(&ids, &dates);
let pubs_presentations = all_publications.try_join(all_presentations);
let grants_committees = all_research_grants_awards.try_join(all_committee_service);
let ppgc = pubs_presentations.try_join(grants_committees);
let ppgc_m = ppgc.try_join(all_mentorships);
let leadership_developments = all_leadership_positions.try_join(all_program_developments);
let appointments_awards = all_appointments.try_join(all_awards_memberships);
let ldaa = leadership_developments.try_join(appointments_awards);
let sbta = all_specialty_boards.try_join(all_teaching_activity);
let ldaas = ldaa.try_join(sbta);
let (
(
(
(mut all_publications, mut all_presentations),
(mut all_research_grants_awards, mut all_committee_service),
),
mut all_mentorships,
),
(
(
(mut all_leadership_positions, mut all_program_developments),
(mut all_appointments, mut all_awards_memberships),
),
(mut all_specialty_boards, mut all_teaching_activity),
),
) = ppgc_m.try_join(ldaas).await?;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment