在Booksleve中的Redis交易(Redis transactions in Booksleve)
下面的3个命令按原样执行时效果很好。
using (var redis = NewRedisConnection) { await redis.Open(); var allKeys = await redis.Keys.Find(db, "searchPattern"); var allVals = await redis.Strings.GetString(db, allKeys); await redis.Keys.Remove(db, allKeys); //process the data I pull from redis }
但是当我尝试将它们包装在一个事务中时它就会停止工作。 不抛出异常,但如果我调试执行似乎停止在
var allKeys = ...
我在设置事务时错过了什么?using (var redis = NewRedisConnection) { await redis.Open(); var tran = redis.Createtransaction(); var allKeys = await tran.Keys.Find(db, "searchPattern"); var allVals = await tran.Strings.GetString(db, allKeys); await tran.Keys.Remove(db, allKeys); await tran.Execute(); //process the data I pull from redis }
The 3 commands below work perfectly when they are executed as is.
using (var redis = NewRedisConnection) { await redis.Open(); var allKeys = await redis.Keys.Find(db, "searchPattern"); var allVals = await redis.Strings.GetString(db, allKeys); await redis.Keys.Remove(db, allKeys); //process the data I pull from redis }
But when I try to wrap them in a transaction it stops working. Exceptions aren't thrown, but if I debug the execution seems to stop at
var allKeys = ...
Am I missing something While setting up the transaction?using (var redis = NewRedisConnection) { await redis.Open(); var tran = redis.Createtransaction(); var allKeys = await tran.Keys.Find(db, "searchPattern"); var allVals = await tran.Strings.GetString(db, allKeys); await tran.Keys.Remove(db, allKeys); await tran.Execute(); //process the data I pull from redis }
原文:https://stackoverflow.com/questions/13435797
满意答案
在初始化Nivo Slider之前添加此代码,并使用triangleNodePrev / Next替换参数。 这具有禁用链接上的默认操作的优点,因此,如果您使用href =“#”,则浏览器不会滚动回页面的顶部。
$('#previousButton, #nextButton').on('click', function (e) { // Prevent the link from being followed e.preventDefault(); // Initialize variables var buttonId = this.id, buttonClass = ('previousButton' == buttonId) ? '.nivo-prevNav' : '.nivo-nextNav'; // Trigger the slider button $('.nivo-directionNav').find(buttonClass).click(); });
Add this code before you initialize Nivo Slider and replace the parameters with your triangleNodePrev / Next. This has the advantage of disabling the default action on your links so that if you use href="#" the browser doesn't scroll back to the top of the page.
$('#previousButton, #nextButton').on('click', function (e) { // Prevent the link from being followed e.preventDefault(); // Initialize variables var buttonId = this.id, buttonClass = ('previousButton' == buttonId) ? '.nivo-prevNav' : '.nivo-nextNav'; // Trigger the slider button $('.nivo-directionNav').find(buttonClass).click(); });
相关问答
更多IE中的Nivo滑块显示问题(Nivo Slider Display Problem in IE)
我的网站上的jQuery Nivo Slider有什么用?(What is up with jQuery Nivo Slider on my site?)
Nivo滑块不居中(Nivo Slider is not centered)
悬停上的nivo滑块显示prev和下一个按钮(nivo slider on hover show prev and next buttons)
使用默认主题将图像置于Nivo Slider上?(Centering image on Nivo Slider using default theme?)
Nivo Slider(raphaeljs)的外部控件(Next / Prev)?(External Controls (Next / Prev) for Nivo Slider (raphaeljs)?)
nivo滑块,是一种总是显示下一个和prev箭头的方法吗?(nivo slider, is a way to always show the next and prev arrows?)
如何使Nivo滑块响应(How to make Nivo Slider Responsive)
使用Flash Builder创建像Nivo滑块一样的图像滑块(Create Image Slider Like Nivo Slider With Flash Builder)
暂停Nivo滑块(Pause Nivo Slider)
相关文章
更多Redis 事务详解
Redis概述
Redis Cookbook
redis安装-redis集群管理
Redis 哈希(Hash)详解
基于linux下redis安装与配置
基于window安装redis
redis 集群环境搭建-redis集群管理
redis 使用笔记01
redis整合spring示例一
最新问答
更多获取MVC 4使用的DisplayMode后缀(Get the DisplayMode Suffix being used by MVC 4)
如何通过引用返回对象?(How is returning an object by reference possible?)
矩阵如何存储在内存中?(How are matrices stored in memory?)
每个请求的Java新会话?(Java New Session For Each Request?)
css:浮动div中重叠的标题h1(css: overlapping headlines h1 in floated divs)
无论图像如何,Caffe预测同一类(Caffe predicts same class regardless of image)
xcode语法颜色编码解释?(xcode syntax color coding explained?)
在Access 2010 Runtime中使用Office 2000校对工具(Use Office 2000 proofing tools in Access 2010 Runtime)
从单独的Web主机将图像传输到服务器上(Getting images onto server from separate web host)
从旧版本复制文件并保留它们(旧/新版本)(Copy a file from old revision and keep both of them (old / new revision))
Copyright ©2023 peixunduo.com All Rights Reserved.粤ICP备14003112号
本站部分内容来源于互联网,仅供学习和参考使用,请莫用于商业用途。如有侵犯你的版权,请联系我们(neng862121861#163.com),本站将尽快处理。谢谢合作!