我们有一个很大的项目即将推出,有很多媒体处理(图像,视频)以及电子邮件输出等,通常我们将这些东西放入一个名为"email_queue"的表中,我们使用cron来运行脚本处理表中的队列.
我已经在像Beanstalkd这样的Message Queue系统上阅读了很多内容,甚至还设置了它.这很容易使用,问题是我不确定我是否遗漏了一些东西.
有人可以详细说明使用队列系统而不是表和CRON的好处吗?因为我真的看不到它们是什么.
谢谢
我正在尝试在我的Windows机器上安装starling gem.但是,每当我尝试安装它时,我都会收到此错误:
Building native extensions. This could take a while...
ERROR: Error installing starling:
ERROR: Failed to build gem native extension.
c:/ruby/bin/ruby.exe extconf.rb install starling -- --srcdir= c:\ruby-1.8.7-p72
checking for windows.h... no
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.
Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--srcdir=.
--curdir
--ruby=c:/ruby/bin/ruby
Gem files will remain …
Run Code Online (Sandbox Code Playgroud) 我有一个具有异步处理的rails应用程序,我无法让它在生产模式下工作.我从应用程序的根开始咆哮,如下所示:
starling -d -P tmp/pids/starling.pid -q log/
Run Code Online (Sandbox Code Playgroud)
然后我开始像这样工作
./script/workling_client start -t
Run Code Online (Sandbox Code Playgroud)
我第一次运行它,它抱怨因为没有开发数据库,所以我创建了一个开发数据库,当我重新开始工作时该错误就消失了.但是当我尝试实际运行异步进程时,我在log/production.log中收到此消息
Workling::QueueserverNotFoundError (config/workling.yml configured to connect to queue server on localhost:15151 for this environment. could not connect to queue server on this host:port. for starling users: pass starling the port with -p flag when starting it.
Run Code Online (Sandbox Code Playgroud)
所以,我跑了
sudo killall starling
Run Code Online (Sandbox Code Playgroud)
然后从应用程序的根目录重新启动starling,如下所示:
starling -d -P tmp/pids/starling.pid -q log/ -p 15151
Run Code Online (Sandbox Code Playgroud)
这似乎工作正常,但当我尝试再次使用此脚本/ workling_client start -t开始处理时,我在控制台中收到此消息
/var/rails-apps/daisi/vendor/plugins/workling/lib/workling/clients/memcache_queue_client.rb:68:in `raise_unless_connected!': config/workling.yml configured to connect to queue server on localhost:22122 for this environment. could not …
Run Code Online (Sandbox Code Playgroud)