예제 #1
0
        public async Task Push()
        {
            var list = new RedisList <int>(GlobalSettings.Default, "listkey1");
            await list.Delete();

            (await list.LeftPush(1)).Is(1);
            (await list.LeftPush(10)).Is(2);
            (await list.LeftPush(new[] { 100, 1000, 10000 }, TimeSpan.FromMilliseconds(1000))).Is(5);

            (await list.Range()).Is(10000, 1000, 100, 10, 1);

            await Task.Delay(TimeSpan.FromMilliseconds(1500));

            (await list.Exists()).IsFalse();

            (await list.RightPush(1)).Is(1);
            (await list.RightPush(10)).Is(2);
            (await list.RightPush(new[] { 100, 1000, 10000 }, TimeSpan.FromMilliseconds(1000))).Is(5);

            (await list.Range()).Is(1, 10, 100, 1000, 10000);

            await Task.Delay(TimeSpan.FromMilliseconds(1500));

            (await list.Exists()).IsFalse();
        }
예제 #2
0
        public async Task Push()
        {
            var list = new RedisList<int>(GlobalSettings.Default, "listkey1");
            await list.Delete();

            (await list.LeftPush(1)).Is(1);
            (await list.LeftPush(10)).Is(2);
            (await list.LeftPush(new[] { 100, 1000, 10000 }, TimeSpan.FromMilliseconds(1000))).Is(5);

            (await list.Range()).Is(10000, 1000, 100, 10, 1);

            await Task.Delay(TimeSpan.FromMilliseconds(1500));

            (await list.Exists()).IsFalse();

            (await list.RightPush(1)).Is(1);
            (await list.RightPush(10)).Is(2);
            (await list.RightPush(new[] { 100, 1000, 10000 }, TimeSpan.FromMilliseconds(1000))).Is(5);

            (await list.Range()).Is(1, 10, 100, 1000, 10000);

            await Task.Delay(TimeSpan.FromMilliseconds(1500));

            (await list.Exists()).IsFalse();
        }