在 Rails 中旋转后台任务 [英] Spinning Background Tasks in Rails

查看:36
本文介绍了在 Rails 中旋转后台任务的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为 Rails 应用程序创建后台任务的首选方法是什么?我听说过 Starling/Workling 和好的 ol' 脚本/运行器,但我很好奇哪一种正在成为满足这种需求的实际方法?

What is the preferred way to create a background task for a Rails application? I've heard of Starling/Workling and the good ol' script/runner, but I am curious which is becoming the defacto way to manage this need?

谢谢!

澄清:我喜欢后台 Rake 的想法,但问题是,我需要一些持续运行或每 10 小时运行一次的东西.我不会坐享其成的网络请求,它需要由与我网站上发生的活动异步的服务器启动.

Clarification: I like the idea of Rake in Background, but the problem is, I need something that is running constantly or every 10 hours. I am not going to have the luxury of sitting on a web request, it will need to be started by the server asynchronous to the activities occurring on my site.

推荐答案

Ryan Bates 创建了三个可能真正对您有帮助的精彩截屏视频:

Ryan Bates created three great screencasts that might really help you:

  1. 后台耙
  2. 八哥和工作
  3. 自定义守护程序

他谈到了使用每种方法的各种优缺点.这应该可以帮助您入门.

He talks about the various pros and cons for using each one. This should help you get started.

这篇关于在 Rails 中旋转后台任务的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆