Exemplo n.º 1
0
        public void Fusing_must_properly_fuse_a_FusedGraph_that_has_been_extended_with_AsyncBoundary()
        {
            var src   = Fusing.Aggressive(Graph(true));
            var fused = Fusing.Aggressive(Source.FromGraph(src).To(Sink.First <int>()));

            Verify(fused, modules: 2, downstreams: 6);
        }
Exemplo n.º 2
0
        public void Fusing_must_not_fuse_accross_AsyncBoundary()
        {
            var g     = Graph(true);
            var fused = Fusing.Aggressive(g);

            Verify(fused, modules: 2, downstreams: 5);
        }
Exemplo n.º 3
0
        public void Fusing_must_fuse_a_moderately_complex_graph()
        {
            var g     = Graph(false);
            var fused = Fusing.Aggressive(g);

            Verify(fused, modules: 1, downstreams: 5);
        }
Exemplo n.º 4
0
        private static void TestFussion()
        {
            var flow  = Flow.Create <int>().Select(x => x * 2).Where(x => x > 500);
            var fused = Fusing.Aggressive(flow);
            var s     = Source.From(Enumerable.Range(0, int.MaxValue)).Via(fused).Take(1000);

            WithMaterializer(m => s.RunForeach(x => Console.WriteLine(x), m)).Wait();
        }
Exemplo n.º 5
0
 private static RunnableGraph <TestLatch> Fuse(IRunnableGraph <TestLatch> graph)
 => RunnableGraph.FromGraph(Fusing.Aggressive(graph));
Exemplo n.º 6
0
        public void Fusing_must_not_fuse_a_FusedGraph_again()
        {
            var g = Fusing.Aggressive(Graph(false));

            Fusing.Aggressive(g).Should().BeSameAs(g);
        }
Exemplo n.º 7
0
 private static IGraph <SourceShape <int>, NotUsed> CreateSource(int count)
 => Fusing.Aggressive(Source.Repeat(1).Take(count));