public void Concat() { Console.WriteLine(MethodBase.GetCurrentMethod().Name); var gen = new InputGenerator(); var definition = StandardOperators.Concat(); using (var instance = ExpressionInstance.Create(definition)) { var a = instance.GetInput("a"); var b = instance.GetInput("b"); b.OnNext2(gen.Next()); b.OnNext2(gen.Next()); a.OnNext2(gen.Next()); a.OnNext2(gen.Next()); a.OnNext2(gen.Next()); b.OnNext2(gen.Next()); a.OnCompleted2(); b.OnNext2(gen.Next()); b.OnNext2(gen.Next()); b.OnCompleted2(); AddDiagram("Concat", instance.Diagram); } }
public void BufferWithTime() { Console.WriteLine(MethodBase.GetCurrentMethod().Name); var gen = new InputGenerator(); var definition = StandardOperators.BufferWithTime(); using (var instance = ExpressionInstance.Create(definition)) { var a = instance.GetInput("a"); Thread.Sleep(100); a.OnNext2(gen.Next()); a.OnNext2(gen.Next()); a.OnNext2(gen.Next()); Thread.Sleep(3000); a.OnNext2(gen.Next()); a.OnNext2(gen.Next()); a.OnCompleted2(); AddDiagram("BufferWithTime", instance.Diagram); } }
public void Amb() { Console.WriteLine(MethodBase.GetCurrentMethod().Name); var gen = new InputGenerator(); var definition = StandardOperators.Amb(); using (var instance = ExpressionInstance.Create(definition)) { var a = instance.GetInput("a"); var b = instance.GetInput("b"); a.OnNext2(gen.Next()); b.OnNext2(gen.Next()); b.OnNext2(gen.Next()); a.OnNext2(gen.Next()); b.OnNext2(gen.Next()); a.OnNext2(gen.Next()); b.OnNext2(gen.Next()); b.OnCompleted2(); a.OnCompleted2(); AddDiagram("Amb", instance.Diagram); } }