Skip to content

Instantly share code, notes, and snippets.

@glikoz
Created July 2, 2020 17:58
Show Gist options
  • Save glikoz/e6ddaabe1776cdf5d242b94e2be7988d to your computer and use it in GitHub Desktop.
Save glikoz/e6ddaabe1776cdf5d242b94e2be7988d to your computer and use it in GitHub Desktop.
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