Rails 并行后台处理
我有一个 Rails 应用程序(它的作用类似于一组打印机的某种负载平衡器),需要进行一些后台处理。后台处理逻辑需要迭代所有可用(非繁忙)打印机,并通过 TCP 套接字向每台打印机发送打印作业(只要存在作业)。
我知道有几种处理后台处理的解决方案(Starling / Workling / ActiveMQ、BackgroundRB、Delayed Job 等),但是最适合我需求的解决方案是什么(我需要为每个解决方案分配一个工作程序/线程)打印机当前可用)?
I have a rails application (which acts like some sort of load balancer for a group of printers) that needs to do some background processing. The background processing logic needs to iterate over all available (non busy) printers and send a print job via TCP socket to each one as long as there are jobs present.
I know there are several solutions out there that deal with background processing (Starling / Workling / ActiveMQ, BackgroundRB, Delayed Job and so on), but what would be the best one to suit my needs (i would need one worker / thread for each printer currently available)?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
DelayedJob 是一个很好且简单的解决方案,因为它集成到您的环境中并且使用您的应用程序数据库。如果您不需要立即从单独的环境开始,那么这是完美的选择。换句话说,除了 Rails 应用程序和数据库本身之外,您不需要其他要求。
Resque 也是另一个很棒的解决方案,但它要求您使用 Redis 数据库。
我没有尝试其他解决方案,因为它们太复杂或被 Redis 和 DelayedJob 取代。
DelayedJob is a good and simple solution because it is integrated into your environment and it uses your application database. This is perfect if you don't immediately need to start with a separate environment. In other words, you don't need additional requirements rather than your Rails application and database itself.
Resque is also an other great solution, but it requires you to use Redis database.
I didn't try other solutions because they were too complex or superseded by Redis and DelayedJob.