rails real-time application - ruby-on-rails

I am building a real-time application ,and I am using private_pub gem based on fayejs
but it doesn't have a lot of features like pusher ex. presence channels which I can fetch online users
for me pusher is expensive for my application
I read some posts about socket.io but I didn't know how to implement it with rails and also if I need to learn node.js before using it
hope any one could help me

I do not know why exactly it is expensive for your application but I have never found any problem.
Please refer this link.
http://net.tutsplus.com/tutorials/ruby/how-to-use-faye-as-a-real-time-push-server-in-rails/

Related

How do I link two apps in node.js and rails?

I run a social network app built in ruby on rails 4. We want to improve it and add realtime and add live streaming features. We also want to make 'likes', 'comments' features real time. My lead programer says ruby on rails is not good for this and not possible and only way is to do it in node.js however doesnt know any solution to link node.js application to rails. I'm a business guy and not technical and need info to let him know it can be done.
Rails 4 doesn't have streaming(like websocket, maybe streaming is not good word in this context) functional from box, but many gems exist for this: https://rubygems.org/search?utf8=%E2%9C%93&query=websocket.
However you can use websocket.io if you decide it is a better solution, for example, in my current project we use websocket.io for send a notifications for mobile application through websocket: rails and nodejs exchanging data through Redis.

Rails and Websocket

So I want to be able to get a live stream of notifications for my users that are using my rails application. I heard that you are able to do this using web sockets but I haven't seen anything about it in rails.
Is there a way to do this in rails or am I able to use something else along side my application such as node.js ?
Okay I started searching for different terms and I was able to find Faye
This tutorial is great for it http://code.tutsplus.com/tutorials/how-to-use-faye-as-a-real-time-push-server-in-rails--net-22600
You can also use something like PubNub http://www.pubnub.com/
They support a good amount of languages/libraries such as AngularJS. Great customer service and documentation. Also many examples such as this one: http://www.pubnub.com/developers/data-streams/twitter-stream

User Messaging with RoR and Mongoid

i searched the web now several hours but get no clear answer.
I have a Rails-App (Ruby 1.9.3/Rails 3.2.2/MongoDB) which uses Devise as User-Authorization.
Now i'd like to have a simple messaging function between users: 1 to 1 and 1 to n.
Are there any gems that fulfill this need and support Mongo or are there any tutorials or best practices for this?
Maybe relevant too: In the next step i plan to make the messages available in an iOS and Android App (both native) too.
You just need implement it. A gem to do that is too specific and need a lot of update to be generic.
I think anyone do that.
Sending message to iOS and Android is completly different so you can't have gem to do that easily. Code it.

instant messenger implementation for rails?

I have searched for some time investigating several technologies to build an simple instant messaging system for a ruby on rails app. It seems very complicated as I haven't found any implementations that are cross browser or any 1-1 proof of concept at all.
Looked into:
xmpp clients ( there is Candy on github only supports group chat )
xmpp servers & Rails ( lot of hassle no good integration )
Juggernaut ( no 1-1 , not supported by Internet Explorer cause of web sockets used)
Private Pub by ryan bates ( seems to be able to do the trick but as ruby newbie with little documentation on this cannot get this figured )
Can anyone suggest me a instant messenger for rails:
that is Cross browser
has good documentation, example of implementation
Instant Messenger where User A talks to User B and User B talks to User A
I really have no idea anymore how I would implement this, anyone can give me advise on how this problem could be tackled? thx
As Eric said, there isn't one. Messaging is a very difficult thing to do.
Right now I'm using Pubnub, which is an external service. There isn't very good documentation on Rails integration, so you'll just have to try to do it yourself.
On the better documented side, there's Faye, but this is an internal process and requires two instances to be running (one to respond to Faye requests, and one to run your app). This was a little trickier (and more expensive) to do on Heroku, so I just stuck to Pubnub.
In terms of Faye documentation, check out this Railscast, and for privacy, check out Private Pub.
edit: if you think Private Pub is hard to integrate.. well, not to be mean, but perhaps you should try to learn more about Rails and Javascript before you delve into this matter, as it's not an easy thing to do (even though it seems like it should be)
edit 2: Also, for faye, this tutorial might help you out.
You might be better off using Node.js for this type of thing.
Work in progress:
full facebook clone
https://github.com/rubytastic/im
please contribute the code is to be fixed and still wacky!

trouble using juggernaut as a rails plugin

i am developing a rails plugin, in which i want a model where server will notify updates to all the connected clients. for simplicity say, on certain event server will say 'hi there is an update' to all the clients.
i came across juggernaut plugin that uses web-sockets and have followed https://github.com/maccman/juggernaut_plugin/tree/c3e07a812341f93bb1f90c00b7a125524b07b80a
but its not working for me.
can any one help me figuring out what am i missing, simply to send an alerts to the clients.
or is there some simpler library or simpler way to get on with it?
any suggestions/comments will be appreciated.
What about Faye? Here's a Railscasts screencast
juggernaut_plugin hasn't been updated for three years. You want Juggernaut, the much more recently and recently-updated version. Try following the instructions for that.

Resources