示例#1
0
        static void Main(string[] args)
        {
            try
            {
                Console.Title = "Redis Streams Showcase";
                Redis         = Common.Redis.InitializeConnection(ConfigurationManager.AppSettings["Redis.Password"]);

                Console.WriteLine("Pick one:");
                Console.WriteLine("  1 - Write into and read values from a stream");
                Console.WriteLine("  2 - Consumer groups: Producer");
                Console.WriteLine("  3 - Consumer groups: Consumer");
                Console.WriteLine();
                Console.Write("> ");

                while (true)
                {
                    var c = Console.ReadKey(true).KeyChar;
                    Console.WriteLine(c);
                    switch (c)
                    {
                    case '1': TestStreams.Execute(Redis); return;

                    case '2': TestConsumerGroups.Execute(Redis, string.Empty); return;

                    case '3': TestConsumerGroups.Execute(Redis, EnterConsumerGroup()); return;

                    default: break;
                    }
                }
            }
            catch (Exception e)
            {
                Tools.PrintExceptionDetails(e);
                Console.Write("<ENTER> ");
                Console.ReadLine();
            }
        }
示例#2
0
 static IEnumerable <object[]> GetTestStreams() => TestStreams.Select(s => new object[] { s });
示例#3
0
 public void GivenAStreamWithSingleErrorAndBackOff()
 {
     Sut = TestStreams.HasOneError().BackOff(Schedulers);
     TimeAdvances();
 }
示例#4
0
 public void GivenAStreamThatWillYieldASingleError()
 {
     Sut = TestStreams.HasOneError();
     TimeAdvances();
 }
示例#5
0
 public void GivenAStreamWithMoreErrorsThanTheBackOffAllows()
 {
     Sut = TestStreams.ErrorsUntil(10000).BackOff(Schedulers, 9999);
     TimeAdvances();
 }
示例#6
0
 public void GivenAStreamWithLotsOfErrorsAndBackOff()
 {
     Sut = TestStreams.ErrorsUntil(10000).BackOff(Schedulers, 10001);
     TimeAdvances();
 }