static void InitClient(FabricClient cli, EventHandler handler)
            {
                if (client == null)
                {
                    if (cli == null)
                    {
                        client = new FabricClient();
                    }
                    else
                    {
                        client = cli;
                    }
                    if (handler != null)
                    {
                        client.ServiceManager.ServiceNotificationFilterMatched += handler;
                    }

                    ServicePartitionResolver resolver =
                        new ServicePartitionResolver(
                            delegate
                    {
                        return(client);
                    }
                            );
                    ServicePartitionResolver.SetDefault(resolver);
                }
            }
Beispiel #2
0
        private static void Main(string[] args)
        {
            if (args.Length > 0)
            {
                string endpoint = args[0];
                Console.WriteLine("Conencting to cluster: " + endpoint);
                ServicePartitionResolver resolver = new ServicePartitionResolver(endpoint);
                ServicePartitionResolver.SetDefault(resolver);
            }

            RunAsync().Wait();

            Console.ReadLine();
        }
Beispiel #3
0
        private static void Main(string[] args)
        {
            if (args.Length > 0)
            {
                string endpoint = args[0];
                Console.WriteLine("Conencting to cluster: " + endpoint);
                ServicePartitionResolver resolver = new ServicePartitionResolver(endpoint);
                ServicePartitionResolver.SetDefault(resolver);
            }

            Items = new List <InventoryItemId>();
            for (int i = 0; i < MaxNumberOfItems; i++)
            {
                Items.Add(new InventoryItemId());
            }

            Timer timer = new Timer(new TimerCallback(GenerateData), null, 0, GenerateDataIntervalInMsec);

            Console.ReadLine();
            timer.Dispose();
        }