阅读背景:

我怎样才能使我的rails应用程序将视图同步到每个用户身上?

来源:互联网 

I am creating a rails app where users can vote on an item every 15 seconds. I want the same item to show up for every user on this website. Basically, I want each session to be synchronized in the content shown. There are two ways that I believe this can be done, but I am not totally sure about the implementation of them. One way is to define a global variable for such an item every 15 seconds. This global variable needs to be the same across all sessions on this website. Another way is to have some background process or main thread running in the back that chooses this item every 15 seconds, and each session gets the current item from this background process. Does anyone have any ideas on how I can do this? Thanks in advance!I am creating a rails app where users can vote




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: