public static IRunnableGraph<NotUsed> GraphWithNestedImportsBuilder(int numberOfNestedGraphs)
{
var flow = Flow.Create<NotUsed>().Select(x => x);
for (var i = 0; i < numberOfNestedGraphs; i++)
flow = Flow.FromGraph(GraphDsl.Create(flow, (b, f) => new FlowShape<NotUsed, NotUsed>(f.Inlet, f.Outlet)));
return RunnableGraph.FromGraph(GraphDsl.Create(flow, (b, f) =>
{
b.From(Source.Single(NotUsed.Instance))
.Via(f)
.To(Sink.Ignore<NotUsed>().MapMaterializedValue(_ => NotUsed.Instance));
return ClosedShape.Instance;
}));
}