Rails 并行后台处理

发布于 2024-09-27 18:21:38 字数 245 浏览 4 评论 0原文

我有一个 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

拒绝两难 2024-10-04 18:21:39

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文