Chris,

A simple in-place upgrade to you system would be to use long-polling instead of 
traditional polling. This would give you near real-time input response and not 
the complexity of a web socket solution. It's hard to get a true real time 
system using traditional request/response lifecycle (rails) unless you have 
some type of evented server a la node, event machine.  Also, I'm pretty sure 
the planning center solution you posted will (the after_commit) callback will 
only work in a single-threaded environment. 

Unless you really want to go w/ web sockets, I would suggest MessageBus (the 
messaging system used in Discuss) and long polling. Has worked great for me.
— 
Thanks,
Alex Egg

켜짐 2015년 3월 13일 에서 오후 5:58:16, Chris McCann ([email protected]) 작성됨:

I'm trying to put together a design for showing realtime data updates in a 
Rails app in response to calls to an API from mobile devices.

We recently released an Android and iOS version of our first app, Vor Vision, 
which allows people to scan images that have an invisible code embedded in 
them.  Think "invisible QR code", only without the ugly.  You can check it out 
here:  vorvision.com

I've built a Rails backend app that hosts the API and allows a user to see 
scans of their images in realtime.  Currently I just do simple Ajax polling but 
I want to significantly improve the app via a websockets-type updating system.

When a mobile user scans an image, the owner of that image, if they are looking 
at the dashboard at that moment, should see the scan count for that image 
increment, along with the geolocation of the latest scan, possibly with a 
little highlighting or other chrome to call the user's attention to the update.

I haven't used React.js, Angular.js or any of the other client-side JS 
frameworks, but one of these seems like a good fit for elegantly updating the 
client side data elements.  The Flux-style architecture (from Facebook) seems 
possibly useful, if it's not overkill.

Using server sent events (SSE) or websockets (via Pusher) seems like a good fit 
for the server side.

Our local Planning Center Online published this:  
http://developers.planningcenteronline.com/2014/09/23/live-updating-rails-with-react.js-and-pusher.html

Has anyone else done this or something similar?  If so, what technology stack 
did you use?  Got any pointers for me?

Thanks all,

Chris
--
--
SD Ruby mailing list
[email protected]
http://groups.google.com/group/sdruby
---
You received this message because you are subscribed to the Google Groups "SD 
Ruby" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

-- 
-- 
SD Ruby mailing list
[email protected]
http://groups.google.com/group/sdruby
--- 
You received this message because you are subscribed to the Google Groups "SD 
Ruby" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to