Created
July 2, 2020 17:58
-
-
Save glikoz/e6ddaabe1776cdf5d242b94e2be7988d to your computer and use it in GitHub Desktop.
This file contains 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
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
var virtualBroker = new VirtualBroker(); | |
var coolStrategy = new CoolStrategy(); | |
var anotherCoolStrategy = new AnotherCoolStrategy(); | |
var graph = RunnableGraph.FromGraph(GraphDsl.Create(b => | |
{ | |
var input = b.Add(Source.From(new[] { new TickData(11, 12), new TickData(12, 13) })); //FAIL- Must be dynamic Queue | |
var processor1 = Flow.Create<TickData>().Select(tick => coolStrategy.ProcessTickData(tick)); | |
var processor2 = Flow.Create<TickData>().Select(tick => anotherCoolStrategy.ProcessTickData(tick)); | |
var sink = Sink.Create<OrderRequest[]>().PreMaterialize(materializer).virtualBroker.ProcessOrders(ors)); // FAIL | |
return ClosedShape.Instance; | |
})); | |
} | |
public class CoolStrategy | |
{ | |
public OrderRequest ProcessTickData(TickData tickData) | |
{ | |
throw new NotImplementedException(); | |
} | |
} | |
public class AnotherCoolStrategy | |
{ | |
public OrderRequest ProcessTickData(TickData tickData) | |
{ | |
throw new NotImplementedException(); | |
} | |
} | |
public class VirtualBroker | |
{ | |
public void ProcessOrders(OrderRequest[] orderRequests) | |
{ | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment