private static void DisplayMenu(IStreamStore streamStore, string url)
        {
            while (true)
            {
                Console.WriteLine("Using stream store: {0}", streamStore.GetType().Name);
                Console.WriteLine("Press w to write 10 messages each to 100 streams");
                Console.WriteLine("Press t to write 100 messages each to 10 streams");
                Console.WriteLine("Press ESC to exit");

                var key = Console.ReadKey();

                switch (key.Key)
                {
                case ConsoleKey.Escape:
                    return;

                case ConsoleKey.W:
                    Write(streamStore, url, 10, 100);
                    break;

                case ConsoleKey.T:
                    Write(streamStore, url, 100, 10);
                    break;

                default:
                    Console.WriteLine("Computer says no");
                    break;
                }
            }
        }
        public IndexResource(IStreamStore streamStore)
        {
            var streamStoreType     = streamStore.GetType();
            var streamStoreTypeName = streamStoreType.Name;

            _data = JObject.FromObject(new
            {
                provider = streamStoreTypeName.Substring(0, streamStoreTypeName.Length - "StreamStore".Length),
                versions = new
                {
                    streamStore = GetVersion(streamStoreType),
                    server      = GetVersion(typeof(IndexResource))
                }
            });
        }
Example #3
0
        public IndexResource(IStreamStore streamStore, Assembly serverAssembly)
        {
            var streamStoreType     = streamStore.GetType();
            var streamStoreTypeName = streamStoreType.Name;
            var versions            = JObject.FromObject(new
            {
                streamStore = GetVersion(streamStoreType)
            });

            versions[serverAssembly?.GetName().Name?.Split('.').LastOrDefault() ?? "Server"] = GetVersion(serverAssembly);

            _data = JObject.FromObject(new
            {
                provider = streamStoreTypeName.Substring(0, streamStoreTypeName.Length - "StreamStore".Length),
                versions
            });
        }