Skip to content

Instantly share code, notes, and snippets.

@vmandic
Created October 25, 2018 16:51
Show Gist options
  • Save vmandic/190a9ff8fdbdb3652a3eb12484d6c75a to your computer and use it in GitHub Desktop.
Save vmandic/190a9ff8fdbdb3652a3eb12484d6c75a to your computer and use it in GitHub Desktop.
meds-processor, p3, s2
public async Task<ISet<HzzoMedsDownloadDto>> Run(ISet<HzzoMedsDownloadDto> meds)
{
await Task.WhenAll(
// NOTE: due to excel docs designed in different ways, we do this separation of work
StartLongRunning(() => ParsePrimaryListsStartingWith2014_02(meds)),
StartLongRunning(() => ParseSupplementaryListsStartingWith2014_02(meds)),
StartLongRunning(() => ParsePrimaryListsUpTo2014_01(meds)),
StartLongRunning(() => ParseSupplementaryListsUpTo2014_01(meds))
);
return meds;
}
Task StartLongRunning(Action a) =>
Task.Factory.StartNew(a, TaskCreationOptions.LongRunning);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment