Created
December 7, 2019 15:21
-
-
Save IntegerMan/a9977e08f4803f3baa00cef9f36e8d9c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public async Task<AnalysisResult> AnalyzeAsync(Resume resume) { | |
var oldAnalyzer = new LegacyAnalyzer(); | |
var newAnalyzer = new ExperimentalAnalyzer(); | |
return await Scientist.ScienceAsync<AnalysisResult>( | |
"Simple Async Experiment", | |
experiment => | |
{ | |
// This analyzer's result will returned | |
experiment.Use(() => oldAnalyzer.AnalyzeAsync(resume)); | |
// This will be run, but its value will not be returned | |
experiment.Try(() => newAnalyzer.AnalyzeAsync(resume)); | |
// Tell Scientist how to compare two results | |
experiment.Compare((x, y) => x.Score == y.Score); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment