Created
February 7, 2020 19:40
-
-
Save JayBazuzi/b2efc5cca007497490570cbf2bedb5d0 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
var zipCodePipe = new InputPipe<ZipCode>("zipCode"); | |
var peanutButtersPipe = zipCodePipe.ProcessFunction( PeanutButterShop.GetAvailable); | |
var jelliesPipe = zipCodePipe.ProcessFunction(JellyShop.GetAvailable); | |
var bestPeanutButterPipe = peanutButtersPipe.Process(_ => _.BestPeanutButter); | |
var bestJelliesPipe = jelliesPipe.Process(_ => _.BestJelly); | |
var joinedPipe = bestPeanutButterPipe.JoinTo(bestJelliesPipe); | |
var sandwichPipe = joinedPipe.Process((bestPeanutButter, bestJelly) => | |
Sandwich.Create(bestPeanutButter, bestJelly)); | |
sandwichPipe.Collect(); | |
var inputs1AndOutputs1 = peanutButtersPipe.GetInputs<ZipCode>().AndOutputs<Sandwich>(); | |
inputs1AndOutputs1.Send(zipCode); | |
return inputs1AndOutputs1.Output1.SingleResult; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment