Skip to content

Instantly share code, notes, and snippets.

@JayBazuzi
Created February 7, 2020 19:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JayBazuzi/b2efc5cca007497490570cbf2bedb5d0 to your computer and use it in GitHub Desktop.
Save JayBazuzi/b2efc5cca007497490570cbf2bedb5d0 to your computer and use it in GitHub Desktop.
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