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