private static void RunServer() { Console.WriteLine("Starting server on port 3001, type exit to quit"); MemstateSettings config = new MemstateSettings(); config.StorageProvider = typeof(InMemoryStorageProvider).FullName; config.LoggerFactory.AddConsole((category, level) => true); var engine = new EngineBuilder(config).Build <KeyValueStore <int> >(); var server = new MemstateServer <KeyValueStore <int> >(config, engine); server.Start(); while (Console.ReadLine() != "exit") { Console.WriteLine("Type exit to quit"); } server.Stop(); Console.WriteLine("Server stopped, hit enter to terminate"); Console.ReadLine(); }
private static Task RunServer() { Console.WriteLine("Starting server on port 3001, type exit to quit"); var settings = new MemstateSettings { FileSystem = new InMemoryFileSystem() }; settings.LoggerFactory.AddConsole((category, level) => true); var engine = new EngineBuilder(settings).Build <KeyValueStore <int> >(); var server = new MemstateServer <KeyValueStore <int> >(settings, engine); server.Start(); while (Console.ReadLine() != "exit") { Console.WriteLine("Type exit to quit"); } server.Stop(); Console.WriteLine("Server stopped, hit enter to terminate"); Console.ReadLine(); return(Task.CompletedTask); }
public Task Stop() { return(Task.WhenAll( _server.Stop(), StopWebConsole())); }
private static void Stop <T>(MemstateServer <T> server) where T : class { server.Stop(); }