private static void Main(string[] args) { var configuration = SimulatorConfiguration.GetCurrentConfiguration(); var instrumentationPublisher = new SenderInstrumentationManager(instrumentationEnabled: true, installInstrumentation: true) .CreatePublisher("Console"); var carEmulator = new SimulationProfile("Console", 1, instrumentationPublisher, configuration); var options = SimulationScenarios .AllScenarios .ToDictionary( scenario => "Run " + scenario, scenario => (Func <CancellationToken, Task>)(token => carEmulator.RunEmulationAsync(scenario, token))); // Add Single shot foreach (var scenario in SimulationScenarios.AllScenarios) { var name = scenario; options.Add( "Send 1 message from " + name, token => carEmulator.RunOneMessageEmulationAsync(name, token) ); } ConsoleHost.WithOptions(options, configuration.ScenarioDuration); }
private static void Main(string[] args) { ConsoleHost.WithOptions(new Dictionary <string, Func <CancellationToken, Task> > { { "Provision Resources", ProvisionResourcesAsync }, { "Run Cold Storage Consumer", RunAsync } }); }
private static void Main(string[] args) { ConsoleHost.WithOptions( new Dictionary <string, Func <CancellationToken, Task> > { { "Provision Resources", ProvisionResourcesAsync }, { "Run Dispatching Processor", RunAsync } }); }