简体   繁体   中英

Rails 3: Long polling OR sockets with IE 9 support

Our rails app acts as a go-between for the UI and a java-powered API at the back. Basically, rails takes requests from the browser, tells the API what it needs, does some normalization and formatting, then hands it back to the browser. Our app is ALSO an installed app, often without internet access. Oh, and it all gets compiled into a JRuby war.

Currently, to get statuses of various things over time, we're running some javascript intervals every X seconds. We've started discussing a better solution to this, but given the requirements above, AND required support for IE9, I'm not sure what the best course of action is, or how to go about implementing it. Basically, I'm looking for some solid examples of either long polling in rails 3, or some kind of sockets implementation that will work for IE9 + our wonky installation/compiling requirement.

I'd appreciate any thoughts or feedback.

The IE 9 requirement rules out a WebSockets implementation.

Basically, I'm looking for some solid examples of either long polling in rails 3

An example for a long polling/polling solution is the MessageBus the Discourse forum software uses. It is a Rails app but they're not on Rails 3 any longer.

https://meta.discourse.org/t/why-does-discourse-not-use-web-sockets/18302

The "message bus" is component that allows us to easily publish information to our clients and between the rails processes in the farm.

https://meta.discourse.org/t/how-discourse-stays-online-message-bus-faye-long-polling/3238/7

Message Bus is opinionated, it only supports the protocol it needs to drive Discourse. It only supports redis for storage. Message Bus does not support web sockets. It only supports polling and long polling.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM