我有一个简单的Rails应用程序,可以将API请求发送到10个不同的提供程序。
程序,流程:
使用Heroku(免费版),能否让我知道使用Rails 4减少响应时间的最佳选择(使用线程,工作程序等)?例子非常感谢,谢谢。
我已经通过使用简单的rails线程解决了这个问题。
threads << Thread.new{something to be done...}
threads << Thread.new{something to be done...}
threads << Thread.new{something to be done...}
threads.map &:join // Wait for all threads to be completed and then continue
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句