News for hackers. Stuff that matters.
Re:Asynchronous ruby framework for websockets, eventsource a... by lifo on Tuesday August 30, 2011 @09:32AM (#2941324)
Cramp is a fully asynchronous web framework that's very good at dealing with thousands of open connections. It supports WebSockets (latest protocol) and Server-sent Events out of the box. Optionally, supports using Ruby 1.9 fibers to prevent spaghetti evented code - which means seamless Active Record integration.
Re:Asynchronous ruby framework for websockets, eventsource a... by boundlessdreamz on Tuesday August 30, 2011 @10:13AM (#2941500)
How does it compare to node.js? When is cramp a good fit compared to node.js and vice versa?
Re:Asynchronous ruby framework for websockets, eventsource a... by lifo on Tuesday August 30, 2011 @10:17AM (#2941516)
It's a great fit when you need to use your existing Ruby code. Active Record models for example. It works very good alongside async sinatra as well.

All said, it all boils down to your personal choice of languages.

Re:Asynchronous ruby framework for websockets, eventsource a... by sshconnection on Tuesday August 30, 2011 @12:22PM (#2942085)
Goliath has a websockets branch and also supports eventsource and streaming pretty easily. If it's something you need, definitely look into Goliath as well.

http://www.igvita.com/2011/08/26/server-sent-event-notificat... https://github.com/postrank-labs/goliath/tree/websockets

Re:Asynchronous ruby framework for websockets, eventsource a... by lifo on Tuesday August 30, 2011 @12:32PM (#2942131)
Personally, I think Cramp's interface is a lot better than Goliath when it comes to streaming, because everything is streaming in Cramp. YMMV. https://github.com/lifo/cramp/blob/master/examples/sse/serve... in case you want to compare. Also, goliath websockets branch looks outdated.

FWIW, I do like Goliath. More async solutions in Ruby the better!

Re:Asynchronous ruby framework for websockets, eventsource a... by petercooper on Tuesday August 30, 2011 @09:30AM (#2941313)
HN meta point here. This link was posted 18 days ago too, but with a forward slash at the end: http://news.ycombinator.com/item?id=2874982 (nonetheless it gets an upvote again for being cool). Potential fix/update for news.arc on this issue or just a useful trick to let slide? :-)
Re:Asynchronous ruby framework for websockets, eventsource a... by lifo on Tuesday August 30, 2011 @09:35AM (#2941340)
Ha! I didn't realize about '/'. I asked in #startups about giving my old thread a bump but no one responded. So I tried making a new post and it worked!
Re:Asynchronous ruby framework for websockets, eventsource a... by petercooper on Tuesday August 30, 2011 @09:53AM (#2941424)
It's unfortunate but there should be better ways for people to repost URLs over time like this one. This seems an appropriate repost in any case considering the first didn't get its due props. It's the links that do crazy well and then somehow get reposted days later that are really annoying ;-)

I didn't know about the / approach but have used the "?" suffix "trick" a couple of times over the years when submitting things that other people put boring/inappropriate titles on that didn't catch on. I believe # will also work since AJAXified URLs need to be supported.

Re:Asynchronous ruby framework for websockets, eventsource a... by chetan51 on Tuesday August 30, 2011 @10:43AM (#2941630)
1. Does this work with Rails?

2. Generally, the "Hello World" for a real-time framework is a simple chat application.

Re:Asynchronous ruby framework for websockets, eventsource a... by lifo on Tuesday August 30, 2011 @10:45AM (#2941642)
1. It can work within the same Rails process if you're using async Rails.

2. http://cramp.in/examples two chat apps there. But I don't have a live demo running.

Re:Asynchronous ruby framework for websockets, eventsource a... by hamidpalo on Tuesday August 30, 2011 @09:35AM (#2941336)
I would really love to see some perf comparisons vs C# or Java.
Re:Asynchronous ruby framework for websockets, eventsource a... by lifo on Tuesday August 30, 2011 @09:39AM (#2941361)
I'd love to see it too! However, I do think the comparisons should be about the ability handle the number of open connections seamlessly and not req/sec. And relevant memory/cpu usages.
Re:Asynchronous ruby framework for websockets, eventsource a... by scraplab on Tuesday August 30, 2011 @01:46PM (#2942448)
Agreed - do you have any anecdotal evidence of how it performs comparatively to say, Erlang or node?
Re:Asynchronous ruby framework for websockets, eventsource a... by bascule on Tuesday August 30, 2011 @01:21PM (#2942325)
This looks cool, but I wish it were http://socket.io compatible