- android - RelativeLayout 背景可绘制重叠内容
- android - 如何链接 cpufeatures lib 以获取 native android 库?
- java - OnItemClickListener 不起作用,但 OnLongItemClickListener 在自定义 ListView 中起作用
- java - Android 文件转字符串
Jesque是我想使用的好工具。
Jesque is an implementation of Resque in Java. It is fully-interoperable with the Ruby and Node.js (Coffee-Resque) implementations.
Jesque is a Maven project and depends on Jedis to connect to Redis, Jackson to map to/from JSON and SLF4J for logging.
但在此之前,我需要更多信息。是否也可以在 Jesque 中检索所有空缺职位?此信息可能对我的监控和脏重启很有用。在异常关闭之后,如果任何其他应用程序已经完成了相同的作业或也在队列中,则检查所有剩余的作业与其他分布式应用程序可能很有用。这可能吗?我想避免这项工作完成两次或更多次,因为负载均衡器后面可能有多个应用程序,如果原始客户端没有得到 OK 或 FAIL 反馈,他会再次尝试,所以有可能有几个相同的工作几个单一的应用程序(负载均衡器!!!)。
我使用 Java,所以也许也可以使用另一个 redis 数据库客户端工具自己查看 REDIS 数据库。如果没有机会用 jesque 做到这一点,这将是我的第二个选择。有谁知道一个好的 Java 的 redis 数据库客户端?
最佳答案
我终于找到了它(应该)的工作方式,我想在这里记录下来。 QueueInfoDAORedisImpl 实现了“QueueInfoDAO”接口(interface)。
this.jedisPool = new JedisPool(jesqueConfig.getHost());
this.queueInfoDAORedisImpl = new net.greghaines.jesque.meta.dao.impl.QueueInfoDAORedisImpl(jesqueConfig, jedisPool);
List<QueueInfo> queueInfos = queueInfoDAORedisImpl.getQueueInfos();
for (QueueInfo queueInfo : queueInfos) {
//here are some QueueInfos like name or size
for (Job queuedJob : queueInfo.getJobs()) {
//read jobs arg,vars or do what you want
}
}
唯一的问题是 queueInfo.getJobs() 返回 null。有人知道为什么吗?似乎从未调用过 DAO setJob(),因此此 var 保持为空。
关于java - 杰斯克(Resque): Get all open delayed jobs in redis db,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27835428/
asyncio.sleep() 的阻塞表亲,time.sleep() , 不能保证它会在请求的时间内休眠。 The actual suspension time may be less than th
在 C# 中,我有以下两个简单示例: [Test] public void TestWait() { var t = Task.Factory.StartNew(() => {
这是一个 linqpad 示例,展示了在短暂延迟后异步执行方法的两种方法。这两个例子似乎做了完全相同的事情。我通常会实现第一个版本(使用 Task.Delay.ContinueWith),但我也看到使
这是一个 linqpad 示例,展示了在短暂延迟后异步执行方法的两种方法。这两个例子似乎做了完全相同的事情。我通常会实现第一个版本(使用 Task.Delay.ContinueWith),但我也看到使
使用 jQuery,我逐渐将“go”类添加到 div div { tranform:translate(20px,20px); opacity:0;
期待: 当 audioplayer.play(atTime: 1) 被调用时,定时器重置为 0,音频播放器在第 1 秒播放 现实: 我试过 delay = 0.000000001, 1, 100000
我一直在阅读 .Net 4.5 中引入的 async/await 语法并对其有所了解。 我找到了简单的示例,其中 Task.Yield 是要走的路,而不是 Application.DoEvents。我
我需要在一个延迟很大的系统中调整PI(D)的增益。这是一个常见的温度 Controller ,但温度探头距离加热器较远。一些进一步的信息: 加热器响应上的任何变化,探头的响应都会延迟约10秒 温度以1
代码很短,但是很经典,单位是秒,就是未测试过服务器资源消耗怎么样: <% Function Delay(s)
为什么这会立即清空文本(忽略延迟)? $('#error_box_text').html('error text').delay(5000).html('') # jQuery 1.4 最佳答案 de
我有一个 $image,我 .fadeIn 和 .fadeOut,然后 .remove .fadeOut 完成。这是我的代码: $image .fadeIn() .fadeOut(func
我希望用户将鼠标悬停在对撞机(只是一个透明矩形)上超过 2 或 3 秒时能够看到描述菜单。我目前正在使用 javaFX 扩展。 我将程序设置为每当我将鼠标悬停在对撞机上时,它都会播放声音效果,但我希望
在我创建的几个 .HTA 脚本中,我需要 VBScript WScript.Sleep 命令,它只是等待几毫秒而不使用 CPU。当我浏览网页时,似乎我不是唯一一个在寻找这个的人: https://ww
我在 javaFX 中创建了一些节点。我需要为每个节点设置动画,以便使用 TranslateTransition 在 Pane 中的某个点到某个点之间进行转换。但我需要使每个节点使用不同的起点独立移动
我需要在用户开始触摸屏幕、移动手指然后结束触摸时执行一些操作。触摸开始工作正常,也可以移动,但触摸结束运行有 0.5-1 秒的延迟。下面有一段代码: -(id) init { if (s
我正在寻找有关 jQuery 的 .delay 函数的帮助。我的网站上有一个弹出表单,我想在 2-3 分钟内随机弹出该表单。我了解如何使用 Math.random(),但我不了解如何使用它生成 120
我无法获取一些 javascript 和 Jquery 来延迟适当的时间。我想更改一些文本,请等待 5 秒钟,然后弹出警报。 代码如下: $('#result').html("Record has p
我有以下 JavaScript 片段: $("#dashboard").addClass("standby").delay(3000).removeClass("standby"); $(".acti
我有以下 JavaScript 片段: $("#dashboard").addClass("standby").delay(3000).removeClass("standby"); $(".acti
我已经编写了一个简单的 jQuery 淡入淡出插件,但我无法让延迟正常工作。它将在第一个项目上起作用,但之后它会被忽略 jQuery (function ($) { $.fn.setupQuo
我是一名优秀的程序员,十分优秀!