Exemple #1
0
        public static void Main(string[] args)
        {
            bool useInprocessService = args.Length == 0;
            bool useYesNoGuru = !useInprocessService && args.Length == 1;
            IGuru guru;
            IGuru realGuru = useYesNoGuru ? new RandomYesNoGuru { MinThinkMillis = 1000, MaxThinkMillis = 1000 } as IGuru : new RandomQuestioningGuru { MinThinkMillis = 1000, MaxThinkMillis = 1000, Locked = new SpinLocked()};
            if (useInprocessService)
            {
                var store = new TransientWisdomStore { MinAddLockMillis = 100, MaxAddLockMillis = 100, MinGetLockMillis = 400, MaxGetLockMillis = 400, Locked = new ThickLocked()};
                guru = new GuruService
                       {
                           RealGuru = realGuru,
                           WisdomDataAccessFind = new TransientWisdomDataAccessFind { Store = store },
                           WisdomDataAccessSave = new TransientWisdomDataAccessSave { Store = store }
                       };
            }
            else
            {
                guru = realGuru;
            }

            IBootstrap bootstrap = new ConsoleBootstrap { Guru = guru };
            bootstrap.Run(args);
        }
Exemple #2
0
 private static void Main(string[] args)
 {
     IBootstrap bootstrap = new ConsoleBootstrap { Guru = new WcfGuruClientProxy() };
     bootstrap.Run(args);
 }