コード例 #1
0
        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);
        }
コード例 #2
0
 private static void Main(string[] args)
 {
     ConsoleHost.WithOptions(new Dictionary <string, Func <CancellationToken, Task> >
     {
         { "Provision Resources", ProvisionResourcesAsync },
         { "Run Cold Storage Consumer", RunAsync }
     });
 }
コード例 #3
0
ファイル: Program.cs プロジェクト: hanin/data-pipeline
 private static void Main(string[] args)
 {
     ConsoleHost.WithOptions(
         new Dictionary <string, Func <CancellationToken, Task> >
     {
         {
             "Provision Resources",
             ProvisionResourcesAsync
         },
         {
             "Run Dispatching Processor",
             RunAsync
         }
     });
 }