当前位置: 首页>>代码示例>>C#>>正文


C# RedisClient.ExecCachedLua方法代码示例

本文整理汇总了C#中RedisClient.ExecCachedLua方法的典型用法代码示例。如果您正苦于以下问题:C# RedisClient.ExecCachedLua方法的具体用法?C# RedisClient.ExecCachedLua怎么用?C# RedisClient.ExecCachedLua使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在RedisClient的用法示例。


在下文中一共展示了RedisClient.ExecCachedLua方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Can_call_Cached_Lua

        public void Can_call_Cached_Lua()
        {
            using (var redis = new RedisClient())
            {
                AddTestKeys(redis, 20);

                var r = redis.ExecCachedLua(LuaScript, sha1 =>
                    redis.ExecLuaSha(sha1, "key:*", "10"));
                Assert.That(r.Children.Count, Is.EqualTo(10));

                r = redis.ExecCachedLua(LuaScript, sha1 =>
                    redis.ExecLuaSha(sha1, "key:*", "10"));
                Assert.That(r.Children.Count, Is.EqualTo(10));
            }
        }
开发者ID:cothienlac86,项目名称:ServiceStack.Redis,代码行数:15,代码来源:LuaCachedScripts.cs

示例2: Can_call_Cached_Lua_even_after_script_is_flushed

        public void Can_call_Cached_Lua_even_after_script_is_flushed()
        {
            using (var redis = new RedisClient())
            {
                var r = redis.ExecCachedLua(LuaScript, sha1 =>
                    redis.ExecLuaSha(sha1, "key:*", "10"));
                Assert.That(r.Children.Count, Is.EqualTo(10));

                redis.ScriptFlush();

                r = redis.ExecCachedLua(LuaScript, sha1 =>
                    redis.ExecLuaSha(sha1, "key:*", "10"));
                Assert.That(r.Children.Count, Is.EqualTo(10));
            }
        }
开发者ID:cothienlac86,项目名称:ServiceStack.Redis,代码行数:15,代码来源:LuaCachedScripts.cs

示例3: Can_call_script_with_complex_response

        public void Can_call_script_with_complex_response()
        {
            using (var redis = new RedisClient())
            {
                var r = redis.ExecCachedLua(KeyAttributesScript, sha1 =>
                    redis.ExecLuaShaAsString(sha1, "key:*", "10"));

                r.Print();

                var results = r.FromJson<List<SearchResult>>();

                Assert.That(results.Count, Is.EqualTo(10));

                var result = results[0];
                Assert.That(result.Id.StartsWith("key:"));
                Assert.That(result.Type, Is.EqualTo("string"));
                Assert.That(result.Size, Is.GreaterThan("value:".Length));
                Assert.That(result.Ttl, Is.EqualTo(-1));
            }
        }
开发者ID:cothienlac86,项目名称:ServiceStack.Redis,代码行数:20,代码来源:LuaCachedScripts.cs


注:本文中的RedisClient.ExecCachedLua方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。